Changeset: 8801ac919cc2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8801ac919cc2
Modified Files:
        tools/merovingian/daemon/forkmserver.c
Branch: default
Log Message:

Don't ignore return value of function fread.


diffs (22 lines):

diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -945,7 +945,7 @@ fork_profiler(char *dbname, sabdb **stat
                        goto startup;
                }
                char buf2[BUFLEN];
-               fread(buf2, 1, BUFLEN, comm);
+               size_t len = fread(buf2, 1, BUFLEN, comm);
 
                if(ferror(comm)) {
                        error = newErr("cannot read from file %s\n", filename);
@@ -955,6 +955,9 @@ fork_profiler(char *dbname, sabdb **stat
                        *log_path = NULL;
                        goto cleanup;
                }
+               if (len == BUFLEN)
+                       len--;
+               buf2[len] = 0;
 
                char expected_command[] = "stethoscope";
                size_t command_len = strlen(expected_command);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to