Skip to content

Instantly share code, notes, and snippets.

@konsolebox
Created August 6, 2024 07:33
Show Gist options
  • Save konsolebox/5af2358f98c761abda278000b69e6914 to your computer and use it in GitHub Desktop.
Save konsolebox/5af2358f98c761abda278000b69e6914 to your computer and use it in GitHub Desktop.
> git diff variables.c examples/loadables/realpath.c
diff --git a/examples/loadables/realpath.c b/examples/loadables/realpath.c
index d52739c9..1cbcaa0d 100644
--- a/examples/loadables/realpath.c
+++ b/examples/loadables/realpath.c
@@ -67,7 +67,7 @@ int
realpath_builtin(WORD_LIST *list)
{
int opt, cflag, vflag, qflag, sflag, aflag, es;
- char *r, realbuf[PATH_MAX], *p, *newpath;
+ char *r, realbuf[PATH_MAX+1], *p, *newpath;
struct stat sb;
#if defined (ARRAY_VARS)
arrayind_t ind;
diff --git a/variables.c b/variables.c
index 6d717757..5c1ba62a 100644
--- a/variables.c
+++ b/variables.c
@@ -5698,7 +5698,7 @@ void
push_source (ARRAY *a, char *filename)
{
char *fn;
- char pathname[PATH_MAX];
+ char pathname[PATH_MAX+1];
if (bash_source_fullpath)
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment