mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-02-26 03:36:35 +00:00
Fix cppcheck warning "scanf without field width limits can crash with huge input data"
Fix following warnings: [examples/pn53x-tamashell.c:162]: (warning) scanf without field width limits can crash with huge input data [libnfc/drivers/acr122_pcsc.c:261]: (warning) scanf without field width limits can crash with huge input data [libnfc/drivers/acr122s.c:441]: (warning) scanf without field width limits can crash with huge input data [libnfc/drivers/arygon.c:210]: (warning) scanf without field width limits can crash with huge input data [libnfc/drivers/arygon.c:522]: (warning) scanf without field width limits can crash with huge input data [libnfc/drivers/pn532_uart.c:187]: (warning) scanf without field width limits can crash with huge input data [utils/nfc-relay-picc.c:176]: (warning) scanf without field width limits can crash with huge input data
This commit is contained in:
@@ -159,7 +159,7 @@ int main(int argc, const char *argv[])
|
||||
while (isspace(cmd[offset])) {
|
||||
offset++;
|
||||
}
|
||||
sscanf(cmd + offset, "%d", &s);
|
||||
sscanf(cmd + offset, "%10d", &s);
|
||||
printf("Pause for %i msecs\n", s);
|
||||
if (s > 0) {
|
||||
sleep(s * SUSP_TIME);
|
||||
|
||||
Reference in New Issue
Block a user