summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO4
-rw-r--r--process_multiples.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/TODO b/TODO
index 3ada509..ef26101 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,4 @@
TODO list. This is mostly so i can plan more granularly and remember small stuff i was working on last time and what i should prioritise first.
This is not my overall big planning board. (1 highest prio, 10 lowest)
-1 - Have a big long think about how the strings will be processed and translate in to actually doing things in the program.
-1 - implement the logic that will actually interpret the validated input
-3 - improve the length check (i have NO idea how it actually works because im slow stupid!)
+1 - improve the length check. If i make the length of an input too big then it seems like the input after the fgets limit gets stuck in stdin and that is kind of a problem.
diff --git a/process_multiples.c b/process_multiples.c
index 61adcb3..0acd82d 100644
--- a/process_multiples.c
+++ b/process_multiples.c
@@ -17,9 +17,17 @@ int check_L_linecount(uint64_t Flines, uint64_t focus) {
return _VALID;
}
-uint64_t call_L_plus_continue(char *multiple) {
+uint64_t call_L_plus_minus_continue(char *multiple) {
- fprintf(stdout, "+ or - CONTINUE %s\n", multiple);
+ char new_multiple[32] = { '\0' };
+
+ int i = 0;
+ int j = 2;
+ for( ; multiple[j] != '\n' ; i++, j++) {
+ new_multiple[i] = multiple[j];
+ }
+
+ fprintf(stdout, "%s\n", new_multiple);
return 0;
}
@@ -91,7 +99,7 @@ uint64_t call_L(char *multiple, uint64_t focus, uint64_t Flines) {
focus = call_L_plus_minus_only(focus, multiple[1], Flines);
return focus;
}
- call_L_plus_continue(multiple);
+ call_L_plus_minus_continue(multiple);
}