unified usage of sizeof. found some potential memory corruptions with that.

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@341 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2010-10-26 18:41:13 +00:00
parent a233d19691
commit 898fa7885a
5 changed files with 26 additions and 26 deletions

View File

@@ -53,8 +53,8 @@ void print_usage(const char *app_name, const struct option options[],
arg_str = "";
break;
}
snprintf(buf, sizeof(buf), "--%-13s%s%s", options[i].name, tmp, arg_str);
if (strnlen(buf, sizeof(buf)) > 24) {
snprintf(buf, sizeof buf, "--%-13s%s%s", options[i].name, tmp, arg_str);
if (strnlen(buf, sizeof buf) > 24) {
printf(" %s\n", buf);
buf[0] = '\0';
}