Welcome to the Builder Academy

Question oasis.c - split_argument

More
05 Nov 2026 20:34 - 05 Nov 2026 20:37 #11069 by krell
Unrelated, probably, to my last post. In oasis.c  the function split_argument() has an int i and a for loop that increments i, but does nothing else with i.
Code:
char *tmp = argument, *ttag = tag, *wrt = argument; int i; for (i = 0; *tmp; tmp++, i++) {   if (*tmp != ' ' && *tmp != '=')     *(ttag++) = *tmp;   else if (*tmp == '=')      break; }


Removed i and changed the for loop to a while loop.
Code:
char *tmp = argument, *ttag = tag, *wrt = argument; while (*tmp) {   if (*tmp != ' ' && *tmp != '=')     *(ttag++) = *tmp;   else if (*tmp == '=')      break; tmp++; }
Last edit: 05 Nov 2026 20:37 by krell. Reason: misleading indentation... XD
The following user(s) said Thank You: thomas

Please Log in or Create an account to join the conversation.

Time to create page: 0.222 seconds