"Damjan Jovanovic" damjan.jov@gmail.com writes:
- do
- {
line = HeapAlloc(GetProcessHeap(), 0, size);if (!line)return NULL;ret = fgets(line, size, file);if (ret != NULL){if (strlen(line) < size - 1)return line;size *= 2;}HeapFree(GetProcessHeap(), 0, line);- } while (ret != NULL);
This won't do what you want.
char *line;while ((line = next_line(originalMenu)) != NULL){if (strstr(line, "<Filename>")){if (strstr(line, name))found = TRUE;fprintf(tempfile, "%s", line);}
strstr is not appropriate for comparing file names. Also you are leaking memory here.