ca/tools: fix type errors in option parsing

(found by sonar/cppcheck)
This commit is contained in:
Ralph Lange
2020-06-09 11:09:59 +02:00
parent f0e143b907
commit 7d1ff1411f
2 changed files with 2 additions and 2 deletions

View File

@@ -157,7 +157,7 @@ int main (int argc, char *argv[])
}
break;
case 's': /* ca_client_status interest level */
if (sscanf(optarg,"%du", &statLevel) != 1)
if (sscanf(optarg,"%u", &statLevel) != 1)
{
fprintf(stderr, "'%s' is not a valid interest level "
"- ignored. ('cainfo -h' for help.)\n", optarg);

View File

@@ -258,7 +258,7 @@ int main (int argc, char *argv[])
}
break;
case '#': /* Array count */
if (sscanf(optarg,"%ld", &reqElems) != 1)
if (sscanf(optarg,"%lu", &reqElems) != 1)
{
fprintf(stderr, "'%s' is not a valid array element count "
"- ignored. ('camonitor -h' for help.)\n", optarg);