diff --git a/qa/lib/newlib/101-files.c b/qa/lib/newlib/101-files.c index ec18bae..25ada03 100644 --- a/qa/lib/newlib/101-files.c +++ b/qa/lib/newlib/101-files.c @@ -3,6 +3,7 @@ #include int main() { + int n; char buf[64]; FILE *fptr; @@ -16,7 +17,8 @@ int main() fptr = fopen("/tmp/qa-fprint.txt", "r"); if(fptr == NULL) exit(2); - fread (buf, 1, 64, fptr); + n = fread (buf, 1, 64, fptr); + buf[n] = '\0'; fclose(fptr); if(strncmp(buf, "DONE", 4) != 0){