index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-08-25 17:14:19 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-25 17:14:19 -0500 |
commit | c5982a3eb5287afdec6c9b859f81795c773da8fe (patch) | |
tree | a7c560c2e6552a0344998766ca966ca740298915 /lib/libalpm/util.c | |
parent | e1dce078b247142f7db80bf2d338e431df34691e (diff) |
-rw-r--r-- | lib/libalpm/util.c | 7 |
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 7e3bc372..cf783893 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -192,7 +192,12 @@ char *_alpm_strtrim(char *str) pch++; } if(pch != str) { - memmove(str, pch, (strlen(pch) + 1)); + size_t len = strlen(pch); + if(len) { + memmove(str, pch, len + 1); + } else { + *str = '\0'; + } } /* check if there wasn't anything but whitespace in the string. */ |