eliminate a stack allocated buffer when generating svg images
Costa Tsaousis committed
Aug 26, 2016 at 03:45 UTC
0982314033620770fa5ea31837a7456b2724a06e
1 file changed
+2
-5
src/web_client.c
+2
-5
@@ -745,8 +745,6 @@ cleanup:
745
}
746
747
int web_client_api_request_v1_badge(struct web_client *w, char *url) {
748
- char buf[100 + 1];
749
-
748
int ret = 400;
749
buffer_flush(w->response.data);
750
@@ -862,13 +860,12 @@ int web_client_api_request_v1_badge(struct web_client *w, char *url) {
860
861
if(!label) {
862
if(alarm) {
865
- snprintfz(buf, 100, "%s%s%s", (rc->rrdset)?rc->rrdset->family:"", (rc->rrdset)?": ":"", rc->name);
866
- char *s = buf;
863
+ char *s = (char *)alarm;
864
while(*s) {
865
if(*s == '_') *s = ' ';
866
s++;
867
}
871
- label = buf;
868
+ label = alarm;
869
}
870
else if(dimensions) {
871
const char *dim = buffer_tostring(dimensions);