Index: cygcheck.cc =================================================================== RCS file: /cvs/src/src/winsup/utils/cygcheck.cc,v retrieving revision 1.76 diff -u -p -r1.76 cygcheck.cc --- cygcheck.cc 19 Jul 2005 21:00:34 -0000 1.76 +++ cygcheck.cc 16 Aug 2005 16:34:28 -0000 @@ -929,7 +929,7 @@ dump_sysinfo_services () printf ("Failed to execute '%s', skipping services check.\n", buf); return; } - size_t nchars = fread ((void *) buf, 1, sizeof (buf), f); + size_t nchars = fread ((void *) buf, 1, sizeof (buf) - 1, f); pclose (f); /* were any services found? */ @@ -939,6 +939,8 @@ dump_sysinfo_services () return; } + buf[nchars] = '\0'; + /* In verbose mode, just run 'cygrunsrv --list --verbose' and copy the entire output. Otherwise run 'cygrunsrv --query' for each service. */ for (char *srv = strtok (buf, "\n"); srv; srv = strtok (NULL, "\n"))