I can specify the maximum amount of characters for scanf to read to a buffer using this technique:
scanf
buffer
char buffer[64]; /* Read one li
Another option is to #define the length of the string:
#define
#define STRING_MAX_LENGTH "%10s"
or
#define DOUBLE_LENGTH "%5f"