commit 684a3c707589742d0776267e54d2bde5015cb62c from: Sven M. Hallberg date: Fri Aug 12 15:42:48 2022 UTC swap the size/nmemb arguments to fwrite in text_extract This might be severely pedantic nit-picking, but we're not writing one element of size nchars, we're writing nchars elements of size 1, hmpf. Yes, nmemb is also a size_t. ;) NB: The main purpose of these arguments is to let fwrite check for overflow when multiplying them. So yes, technically the order almost certainly doesn't matter when one of them is 1. It does affect the return value (which is not checked here) in that it will report how many bytes were written in one case or just 0/1 in the other. commit - 8e6d7f724145a06ab2ac35d8707dc5b4c730bc07 commit + 684a3c707589742d0776267e54d2bde5015cb62c blob - 1f95ebeb7d5350a578fe4111ee9421d3b82b4a46 blob + 07edfd51ed5a272b0951e621c72f98eb4a5fd7ff --- pdf.c +++ pdf.c @@ -2202,7 +2202,7 @@ text_extract(struct Env *aux, const char *outfn, const pp_fontinfo(stream, &txte->node->ts, ft); else fputs("\nMissing Font Info!!\n", stream); - fwrite(tstr->text, (size_t)tstr->nchars, 1, stream); + fwrite(tstr->text, 1, (size_t)tstr->nchars, stream); } }