diff options
Diffstat (limited to 'io/tst-getcwd.c')
-rw-r--r-- | io/tst-getcwd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/io/tst-getcwd.c b/io/tst-getcwd.c index 3dac2fbe6b..4b5bc62c7c 100644 --- a/io/tst-getcwd.c +++ b/io/tst-getcwd.c @@ -120,12 +120,20 @@ getcwd (NULL, sbs) = \"%s\", getcwd (thepath, sizeof thepath) = \"%s\"\n", free (bufs[2]); } + memset (thepath, '\xfe', sizeof (thepath)); if (getcwd (thepath, len) != NULL) { puts ("getcwd (thepath, len) didn't failed"); return 1; } + for (i = len; i < sizeof thepath; ++i) + if (thepath[i] != '\xfe') + { + puts ("thepath[i] != '\xfe'"); + return 1; + } + /* Now test handling of correctly sized buffers. */ bufs[0] = getcwd (NULL, len + 1); if (bufs[0] == NULL) |