#define CLIENT_PRIVATE_KEY "client-private.PEM"
#endif
+#define MAX_USER_INPUT_LEN 200
+
gboolean test_thread(GIOChannel *source,
GIOCondition condition,
gpointer data);
static void _test_get_user_input(char *buf, char *what)
{
+ char format[12];
+
+ snprintf(format, 12, " %%%d[^\n]s", MAX_USER_INPUT_LEN);
printf("Please ENTER %s:", what);
- if (scanf(" %[^\n]s", buf) < 0)
+ if (scanf(format, buf) < 0)
printf("Error in Reading the data to Buffer\n");
}
int test_vpn_settings_add(void)
{
int rv = 0;
- char buf[100];
+ char buf[MAX_USER_INPUT_LEN + 1];
_test_get_user_input(&buf[0], "Type");
rv = vpn_settings_set_type(&buf[0]);
int test_vpn_settings_set_specific(void)
{
int rv = 0;
- char key[100];
- char value[200];
+ char key[MAX_USER_INPUT_LEN + 1];
+ char value[MAX_USER_INPUT_LEN + 1];
_test_get_user_input(&key[0], "Key");
_test_get_user_input(&value[0], "Value");