Closed nutsi closed 11 years ago
Hi, in src/main.c at line 238 we can see the following code:
238 if (fwrite(ob->data, sizeof(uint8_t), ob->size, fp) < 0) { 239 printf("failed to write '%s'\n", todo_txt); 240 rt = RE_IO_ERROR; 241 }
fwrite returns an unsigned int (size_t), so this condition is broken. To fix it, just check correctly the number of caracteres who are writen. Like that: if (fwrite(ob->data, sizeof(uint8_t), ob->size, fp) != ob->size)
fwrite
if (fwrite(ob->data, sizeof(uint8_t), ob->size, fp) != ob->size)
regards,
fixed in commit https://github.com/hit9/todo.c/commit/9aeac63f1413aab9a52fe33c5f0300abe5318ef9
Hi, in src/main.c at line 238 we can see the following code:
238 if (fwrite(ob->data, sizeof(uint8_t), ob->size, fp) < 0) { 239 printf("failed to write '%s'\n", todo_txt); 240 rt = RE_IO_ERROR; 241 }
fwrite
returns an unsigned int (size_t), so this condition is broken. To fix it, just check correctly the number of caracteres who are writen. Like that:if (fwrite(ob->data, sizeof(uint8_t), ob->size, fp) != ob->size)
regards,