Fix for wrong usage of strncat (thanks Pavol)
authorPavol Rusnak <prusnak@users.sourceforge.net>
Sun, 7 Dec 2008 07:18:34 +0000 (00:18 -0700)
committerBrenden Matthews <brenden@rty.ca>
Sun, 7 Dec 2008 07:18:34 +0000 (00:18 -0700)
.gitignore
ChangeLog
src/users.c

index ebc4657..c912551 100644 (file)
@@ -24,3 +24,4 @@ conky-*.tar.*
 doc/*.html
 doc/*.mxml
 doc/conky.1
+patches/
index 1fe1893..841006b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
        * Switching from svn to git repository.  The repo can be viewed from
        http://git.omp.am/?p=conky.git;a=summary and you can clone the repo with:
        git clone git://git.omp.am/conky.git
+       * Fix for wrong usage of strncat (thanks Pavol)
 
 2008-12-06
        * Removed duplicate sanity check for diskio
index d833da7..a684bc1 100644 (file)
@@ -101,7 +101,7 @@ static void user_time(char *ptr)
                                strftime(buf, BUFLEN, "%Mm", dtime);
                        }
                        if (strlen(ptr) + strlen(buf) + 1 <= BUFLEN) {
-                               strncat(ptr, buf, BUFLEN);
+                               strncat(ptr, buf, BUFLEN-strlen(ptr)-1);
                        }
                }
        }