Silenced a warning of cppcheck about possible null pointer dereference.

This commit is contained in:
Thomas Schmitt 2011-07-06 12:31:37 +02:00
parent 91e99703b4
commit 91a8be5262
1 changed files with 2 additions and 2 deletions

View File

@ -1574,12 +1574,12 @@ void strncpy_pad(char *dest, const char *src, size_t max)
if (src != NULL) {
len = MIN(strlen(src), max);
for (i = 0; i < len; ++i)
dest[i] = src[i];
} else {
len = 0;
}
for (i = 0; i < len; ++i)
dest[i] = src[i];
for (i = len; i < max; ++i)
dest[i] = ' ';
}