Fri, 09 Sep 2022 20:17:23 +0200
fix net_printf not working with empty strings
src/server/util/io.c | file | annotate | diff | comparison | revisions |
--- a/src/server/util/io.c Thu Sep 08 17:34:16 2022 +0200 +++ b/src/server/util/io.c Fri Sep 09 20:17:23 2022 +0200 @@ -735,7 +735,7 @@ va_list arg; va_start(arg, format); sstr_t buf = ucx_vasprintf(ucx_default_allocator(), format, arg); - ssize_t r = net_write(fd, buf.ptr, buf.length); + ssize_t r = buf.length > 0 ? net_write(fd, buf.ptr, buf.length) : 0; free(buf.ptr); va_end(arg); if(r < 0) {