Dunno what I changed...
This commit is contained in:
parent
91d8dd0bcd
commit
2045f178cc
26
xtandard.c
26
xtandard.c
@ -573,31 +573,25 @@ int character_compare_array (char character, char * character_array) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
int character_count (char * string, int from, int to, char this, char stop) {
|
||||
int character_count (char * string, char this, int from, int to, char stop) {
|
||||
int count;
|
||||
|
||||
for (count = 0; (from != to) && (string [from] != stop); from += (int) ((to < from) ? -1 : 1)) {
|
||||
count += (int) ((string [from] == this) || (this == '\0'));
|
||||
}
|
||||
/*
|
||||
if (to < from) {
|
||||
for (count = 0; to < from; --from) {
|
||||
if ((string [from] == this) || (this == '\0')) {
|
||||
++count;
|
||||
}
|
||||
if (string [from] == stop) {
|
||||
break;
|
||||
}
|
||||
for (count = 0; (to < from) && (string [from] != stop); --from) {
|
||||
count += (int) ((string [from] == this) || (this == '\0'));
|
||||
}
|
||||
} else if (from < to) {
|
||||
for (count = 0; from < to; ++from) {
|
||||
if (string [from] == this) {
|
||||
++count;
|
||||
}
|
||||
if (string [from] == stop) {
|
||||
break;
|
||||
}
|
||||
for (count = 0; (from < to) && (string [from] != stop); ++from) {
|
||||
count += (int) ((string [from] == this) || (this == '\0'));
|
||||
}
|
||||
} else {
|
||||
count = 0;
|
||||
}
|
||||
|
||||
*/
|
||||
return (count);
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ extern int character_is_hexadecimal (char character);
|
||||
|
||||
extern int character_compare_array (char character, char * character_array);
|
||||
|
||||
extern int character_count (char * string, int from, int to, char this, char stop);
|
||||
extern int character_count (char * string, char this, int from, int to, char stop);
|
||||
|
||||
extern int string_length (char * string);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user