This commit is contained in:
biglyderv 2025-04-03 13:48:03 -04:00
parent bab758e93f
commit 1f70dd7000
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5

View file

@ -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;
}