summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: af68ee5)
raw | patch | inline | side by side (parent: af68ee5)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 28 Oct 2009 05:14:03 +0000 (05:14 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 28 Oct 2009 05:14:03 +0000 (05:14 +0000) |
speed increasse. Only copy as many bytes as necessary. During journal
replay, avoid unnecessary copy (string is discarded). Bug reported by
Thorsten von Eicken Patched by kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1961 a5681a0c-68f1-0310-ab6d-d61299d08faa
replay, avoid unnecessary copy (string is discarded). Bug reported by
Thorsten von Eicken Patched by kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1961 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_daemon.c | patch | blob | history |
diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c
index 0ca1818d462b40e0bdd766c2de45eda6003178ef..19460032ad911d9c98613ec5faebf959da769e7c 100644 (file)
--- a/src/rrd_daemon.c
+++ b/src/rrd_daemon.c
cache_item_t *ci;
/* save it for the journal later */
- strncpy(orig_buf, buffer, sizeof(orig_buf)-1);
+ if (sock != NULL)
+ strncpy(orig_buf, buffer, buffer_size);
status = buffer_get_field (&buffer, &buffer_size, &file);
if (status != 0)