cesanta / mongoose

Embedded Web Server
https://mongoose.ws
Other
11.16k stars 2.73k forks source link

error value taken from mg_queue after using mg_queue_printf #2946

Closed o4worksp closed 1 month ago

o4worksp commented 1 month ago

[root@localhost mongoose-7.15]# cat test.c

include "mongoose.h"

int main(void) { char send[1024]; struct mg_queue queue; mg_queue_init(&queue, send, 1024); const char* str = "Hello, World!"; MG_INFO(("%u",mg_queue_printf(&queue, "%s", str)));

char *recv; if (mg_queue_next(&queue, &recv) > 0) { MG_INFO(("%s",recv)); }

return 0; } [root@localhost mongoose-7.15]# ./a.out 7dde739 2 test.c:8:main 13 7dde739 2 test.c:13:main H [root@localhost mongoose-7.15]#

Environment

scaprile commented 1 month ago

This is not the proper way to report an issue This is not the proper way to use Mongoose Please see our documentation, and follow the guidelines in our tutorials.