I recently ran a full leak check with valgrind only to discover this error and "Conditional jump or move depends on uninitialised value(s)" it has been throwing. What am i doing wrong here? It keeps pointing to this function:
int tldlist_add(TLDList *tld, char *hostname, Date *d) {
if (date_compare(tld->begin, d) > 0 || date_compare(tld->end, d) < 0)
return 0;
char *dot = strrchr(hostname, '.') + 1;
int i = 0;
while (i < sizeof(dot))
{
dot[i] = tolower(dot[i]);
i++;
}
char *temptld = (char *)malloc(sizeof(dot));
strcpy(temptld, dot);
tld->root = addnode(tld, temptld, tld->root);
tld->count++;
return 1;
}
specifically at this line: dot[i] = tolower(dot[i]);
Any help would be greatly appreciated, thank you!