From d2ca52edb7152c5bb9ffdb099048de20d15f86e8 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 10 Apr 2020 20:18:15 -0400 Subject: Write escapeXML in the same order as escapeURL --- template.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/template.c b/template.c index 435769c..750f339 100644 --- a/template.c +++ b/template.c @@ -48,20 +48,20 @@ int escapeURL(FILE *file, const char *str) { int escapeXML(FILE *file, const char *str) { while (*str) { - int n = 0; - switch (*str) { - break; case '"': n = fprintf(file, """); str++; - break; case '&': n = fprintf(file, "&"); str++; - break; case '<': n = fprintf(file, "<"); str++; - break; case '>': n = fprintf(file, ">"); str++; - } - if (n < 0) return n; size_t len = strcspn(str, "\"&<>"); if (len) { size_t n = fwrite(str, len, 1, file); if (!n) return -1; } str += len; + int n = 0; + switch (*str) { + break; case '"': str++; n = fprintf(file, """); + break; case '&': str++; n = fprintf(file, "&"); + break; case '<': str++; n = fprintf(file, "<"); + break; case '>': str++; n = fprintf(file, ">"); + } + if (n < 0) return n; } return 0; } -- cgit 1.4.1 tree/www/photo.causal.agency/2024-06-08/R1-07534-031A.txt?id=4de2e36bc2c165102db6a1a64974399d8e8d90b1'>tree commit diff
path: root/www/photo.causal.agency/2024-06-08/R1-07534-031A.txt (unfollow)
Commit message (Expand)Author
2024-12-29Add photos from December 28June McEnroe
2024-12-29Fancify the manual lens textJune McEnroe
2024-12-28Update film preset list with what I expect to keep shootingJune McEnroe
2024-12-28Add the past few months of rolls of filmJune McEnroe
2024-11-13Add Tea with the Black DragonJune McEnroe
2024-11-05Add a bunch of photosJune McEnroe
2024-10-12Publish "film review"June McEnroe
2024-10-12Add photos from October 6June McEnroe
2024-10-12Add photos from October 5June McEnroe
2024-10-09Add photos from October 1June McEnroe
2024-10-07Add photos from September 29June McEnroe
2024-10-07Add photos from September 28June McEnroe
2024-10-07Add photos from September 22June McEnroe
2024-09-25Add photos from September 15June McEnroe
2024-09-24Add photos from September 14June McEnroe
2024-09-24Add photos from September 12June McEnroe
2024-09-24Add photos from September 7June McEnroe
2024-09-24Allow not having descriptionsJune McEnroe
2024-09-23Automatically select the last used lens for a bodyJune McEnroe
2024-09-19Add photos from September 5June McEnroe
2024-09-15Add some more film stocks to the listJune McEnroe
2024-09-13Add photos from September 2June McEnroe
2024-09-13Add Fomapan 200 to films listJune McEnroe
2024-09-10Add August 29 picnic photosJune McEnroe
2024-09-08Apply some bold to trips renderingJune McEnroe
2024-09-08Render trips hopefully more efficientlyJune McEnroe
2024-09-08Allow removing bodies and lensesJune McEnroe
2024-09-08Limit body width so it looks less silly on desktopJune McEnroe
2024-09-07Handle no film being loadedJune McEnroe
2024-09-07Fancy up the text a littleJune McEnroe