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:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user