summaryrefslogtreecommitdiffstats
path: root/cqrlogo.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-05-30 23:18:34 +0200
committerGravatar Christian Hesse <mail@eworm.de>2013-05-30 23:18:34 +0200
commit7f84fb9489f55b373db819b5117e706c75578300 (patch)
tree42291e4eeb9847300b6b6f01671929a20eec43a7 /cqrlogo.c
parentac49c6c586b6c232741da6c39dcee684eeb94119 (diff)
downloadcqrlogo-7f84fb9489f55b373db819b5117e706c75578300.tar.gz
cqrlogo-7f84fb9489f55b373db819b5117e706c75578300.tar.zst
cut http_referer for meta data if longer than 79 chars
Diffstat (limited to 'cqrlogo.c')
-rw-r--r--cqrlogo.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/cqrlogo.c b/cqrlogo.c
index 9b76e5f..06717c5 100644
--- a/cqrlogo.c
+++ b/cqrlogo.c
@@ -107,6 +107,15 @@ int main(int argc, char **argv) {
/* print HTTP header */
printf("Content-Type: image/png\n\n");
+ /* cut http_referer, text in png file may have a max length of 79 chars */
+ if (strlen(http_referer) > 79) {
+ if (!rc) {
+ http_referer = strdup(http_referer);
+ rc = 1;
+ }
+ sprintf(http_referer + 76, "...");
+ }
+
/* print PNG data */
gdk_pixbuf_save_to_buffer (pixbuf, &buffer, &size, "png", NULL,
"compression", "9",