Skip to content
Snippets Groups Projects
Commit e020f6f8 authored by Stephen D's avatar Stephen D
Browse files

Critical string bug fixed, slight reformatting

parent e7c0905b
No related branches found
No related tags found
No related merge requests found
......@@ -61,19 +61,19 @@ int strcmp(char s1[], char s2[]) {
void strsplit(char *orig, char separator, char *a, char *b) {
int found = 0;
for(int i = 0; i < strlen(orig); i++) {
if (orig[i] == separator) found = i + 1; //+1 for the seperator char
if (found > 0) {
b[i - found] = orig[i];
} else {
a[i] = orig[i];
}
if (orig[i] == separator && found == 0) found = i + 1; //+1 for the seperator char
if (found > 0) {
b[i - found] = orig[i];
} else {
a[i] = orig[i];
}
}
}
void tolowercase(char *in) {
for(int i = 0; i < strlen(in); i++) {
if(in[i] >= 65 && in[i] <= 90) {
in[i] += 32;
}
if(in[i] >= 65 && in[i] <= 90) {
in[i] += 32;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment