ugh
This commit is contained in:
parent
bab758e93f
commit
1f70dd7000
1 changed files with 7 additions and 3 deletions
|
@ -125,15 +125,19 @@ int success_handler(const void *key, size_t size, uintptr_t val, void *usr) {
|
|||
struct succ *verified = (struct succ *)usr;
|
||||
|
||||
char *val2 = (char *)val;
|
||||
char *val3 = malloc(strlen(val2) + 1);
|
||||
strcpy(val3, val2);
|
||||
|
||||
if ((char *)val != verified->sugg && val2[strlen(val2) - 1] == '\n') {
|
||||
val2[strlen(val2) - 1] = '\0';
|
||||
if (val3[strlen(val3) - 1] == '\n') {
|
||||
val3[strlen(val3) - 1] = '\0';
|
||||
}
|
||||
|
||||
if (strcmp(verified->sugg, (char *)val) == 0) {
|
||||
if (strcmp(verified->sugg, val3) == 0) {
|
||||
verified->points[0]++;
|
||||
}
|
||||
|
||||
free(val3);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue