Post AWH0le2Zd1EPq3QPlQ by charette@lor.sh
(DIR) More posts by charette@lor.sh
(DIR) Post #AWH0le2Zd1EPq3QPlQ by charette@lor.sh
2023-06-02T05:57:54Z
0 likes, 0 repeats
I have no idea why it took me this long to notice. This application uses: printf("\nblah blah");Instead of: printf("blah blah\n");Part of the problem is when it prints a warning or an error and then waits for the user to press a key to continue. Without the trailing \n, the error message never gets flushed!I cannot fix this without touching every single printf() in this old-style C application.This may encourage me to switch everything to C++ sooner.#cpp #c
(DIR) Post #AWH0led5RGRFfIVZg0 by dump_stack@lor.sh
2023-06-02T07:08:41Z
0 likes, 0 repeats
@charette setvbuf(stdout, NULL, _IONBF, 0);
(DIR) Post #AWH0rulgLfrBSJVuwS by charette@lor.sh
2023-06-02T07:09:49Z
0 likes, 0 repeats
@dump_stack No, this needs a bit more cleanup than that! The line buffering thing is just 1 example of things that are wrong.
(DIR) Post #AWH3C06SQFJ7haw92G by dump_stack@lor.sh
2023-06-02T07:35:51Z
0 likes, 0 repeats
@charette, sure. I just prefer to put crutches first, then cover with tests. Then to do the actual refactoring. Otherwise it's too much pain to revive old projects.