X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_tail.c;h=365bf558b55065fdae6327401495e5b1751ef878;hb=711f5b6c86f51061c21bedcaa46214a01de0125c;hp=55a32879f93d4ce0dba34b85ad92f648dd7e5896;hpb=16ce118c7a69efb49a289b07958bc5a22dc0942e;p=collectd.git diff --git a/src/utils_tail.c b/src/utils_tail.c index 55a32879..365bf558 100644 --- a/src/utils_tail.c +++ b/src/utils_tail.c @@ -142,7 +142,7 @@ int cu_tail_readline(cu_tail_t *obj, char *buf, int buflen) { * be fine and we can return. */ clearerr(obj->fh); if (fgets(buf, buflen, obj->fh) != NULL) { - buf[buflen - 1] = 0; + buf[buflen - 1] = '\0'; return 0; } @@ -168,7 +168,7 @@ int cu_tail_readline(cu_tail_t *obj, char *buf, int buflen) { /* If we get here: file was re-opened and there may be more to read.. Let's * try again. */ if (fgets(buf, buflen, obj->fh) != NULL) { - buf[buflen - 1] = 0; + buf[buflen - 1] = '\0'; return 0; }