summaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-04-04 20:32:33 +0200
committerOskar <[email protected]>2024-04-04 20:32:33 +0200
commitd64a70597d4d5af00d8b372bebf271ad068eadb4 (patch)
treefdeefdfa8c488473c5d8cd91775619223d5f9307 /input.c
parent1f0fea8d157876d8a89d0b530608fa473b1331f2 (diff)
Bugfixes. Still some things i gotta iron out. This is getting more and
more complicated each day. Not sure if i like it. Although at least its not as complicated as it would have been if i would have kept the old validate_L and validate_N code. That would have been a bigger nightmare.
Diffstat (limited to 'input.c')
-rw-r--r--input.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/input.c b/input.c
index 86e0d36..c94aaa3 100644
--- a/input.c
+++ b/input.c
@@ -8,8 +8,10 @@
#include "i_validation.h"
#include <stdint.h>
+int clfstdin_doubleprint; // variable accessed via extern int in startmode so that it does not print '?' 2 times in a row
+
int check_length_fix_stdin(char *smode_buf) {
-
+
int sbl = 0;
for ( ; sbl < SMODE_MAX_INPUT_SIZE ; sbl++) {
if(smode_buf[sbl] == '\0' || smode_buf[sbl] == '\n') {
@@ -19,7 +21,9 @@ int check_length_fix_stdin(char *smode_buf) {
if (sbl >= SMODE_MAX_INPUT_SIZE) {
char c;
while ((c = getchar()) != '\n');
- //fprintf (stderr, "sbl > SMODE_MAX_SIZE\n");
+ fprintf (stdout, "?\n");
+ clfstdin_doubleprint = 0;
+ //fprintf (stderr, "sbl > SMODE_MAX_SIZE\n"); // debug code
return _FAIL;
}