Fixed possible buffer overrun

This commit is contained in:
Jaroslav Kysela 2003-10-17 07:34:19 +00:00
parent d6e0630ab2
commit 3d3fbd78e8

View file

@ -1486,7 +1486,8 @@ int main(int argc, char *argv[])
break; break;
case 'D': case 'D':
case HELPID_DEVICE: case HELPID_DEVICE:
strcpy(card, optarg); strncpy(card, optarg, sizeof(card-1));
card[sizeof(card)-1] = '\0';
break; break;
case 'q': case 'q':
case HELPID_QUIET: case HELPID_QUIET: