Changeset: 9b092f183a1a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9b092f183a1a
Modified Files:
        monetdb5/modules/mal/tablet.c
Branch: default
Log Message:

pass the proper length to the strncpy function


diffs (30 lines):

diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -363,10 +363,10 @@ output_line(char **buf, int *len, char *
                                        if (*buf == NULL)
                                                return -1;
                                }
-                               strncpy(*buf + fill, p, *len - fill - 1);
+                               strncpy(*buf + fill, p, l);
                                fill += l;
                        }
-                       strncpy(*buf + fill, f->sep, *len - fill - 1);
+                       strncpy(*buf + fill, f->sep, f->seplen);
                        fill += f->seplen;
                }
        }
@@ -403,11 +403,11 @@ output_line_dense(char **buf, int *len, 
                                if (*buf == NULL)
                                        return -1;
                        }
-                       strncpy(*buf + fill, p, *len - fill - 1);
+                       strncpy(*buf + fill, p, l);
                        fill += l;
                        f->p++;
                }
-               strncpy(*buf + fill, f->sep, *len - fill - 1);
+               strncpy(*buf + fill, f->sep, f->seplen);
                fill += f->seplen;
        }
        if (fd && mnstr_write(fd, *buf, 1, fill) != fill)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to