Posts: 887
Threads: 251
Joined: Jun 2011
Reputation:
0
Is it really bad if someone types in a longer string than their supposed to and that warning appears? Is there a way to prevent this?
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Use a one-size-fits-all string or check the length beforehand.
Posts: 2,593
Threads: 34
Joined: Dec 2007
yes you can use strlen
if(strlen(params) >= sizeof(string) || sscanf( ... ) )