On Wed, Dec 13, 2023 at 09:49:07PM +0000, Dmitry Karpov via curl-library wrote: > I propose to add a simple check for the cookie file name length and call > fopen() only if it is greater than zero like:
Sounds reasonable. > if(data) { > FILE *fp = NULL; > - if(file) { > + if(file && strlen(file) > 0) { > if(!strcmp(file, "-")) This forces a traversal of the entire string, which isn't necessary. This would be much faster: if(file && *file) { Are you able to turn this into a PR? Dan -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html