diff options
author | Nikias Bassen | 2023-07-05 13:00:57 +0200 |
---|---|---|
committer | Nikias Bassen | 2023-07-05 13:00:57 +0200 |
commit | 8163ca0c237da92a2c1ab31eae2480d1e76a9d01 (patch) | |
tree | 4900f45f081988ab35af2984cc758f621846621f | |
parent | e57b6e7163277c6a63f22a7e2942cf666cf71a80 (diff) | |
download | libimobiledevice-8163ca0c237da92a2c1ab31eae2480d1e76a9d01.tar.gz libimobiledevice-8163ca0c237da92a2c1ab31eae2480d1e76a9d01.tar.bz2 |
Silence (v)asprintf related compiler warnings
-rw-r--r-- | common/debug.c | 4 | ||||
-rw-r--r-- | src/reverse_proxy.c | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/common/debug.c b/common/debug.c index 6212e71..3492eaa 100644 --- a/common/debug.c +++ b/common/debug.c @@ -60,7 +60,7 @@ static void debug_print_line(const char *func, const char *file, int line, const strftime(str_time, 254, "%H:%M:%S", localtime (&the_time)); /* generate header text */ - (void)asprintf(&header, "%s %s:%d %s()", str_time, file, line, func); + if(asprintf(&header, "%s %s:%d %s()", str_time, file, line, func)<0){} free (str_time); /* trim ending newlines */ @@ -86,7 +86,7 @@ void debug_info_real(const char *func, const char *file, int line, const char *f /* run the real fprintf */ va_start(args, format); - (void)vasprintf(&buffer, format, args); + if(vasprintf(&buffer, format, args)<0){} va_end(args); debug_print_line(func, file, line, buffer); diff --git a/src/reverse_proxy.c b/src/reverse_proxy.c index 3ab1031..bca0a13 100644 --- a/src/reverse_proxy.c +++ b/src/reverse_proxy.c @@ -25,6 +25,9 @@ #endif #include <string.h> #include <stdlib.h> +#define _GNU_SOURCE 1 +#define __USE_GNU 1 +#include <stdio.h> #include <errno.h> #include <plist/plist.h> @@ -91,7 +94,7 @@ static void _reverse_proxy_log(reverse_proxy_client_t client, const char* format va_list args; va_start(args, format); char* buffer = NULL; - (void)vasprintf(&buffer, format, args); + if(vasprintf(&buffer, format, args)<0){} va_end(args); client->log_cb(client, buffer, client->log_cb_user_data); free(buffer); @@ -113,7 +116,7 @@ static void _reverse_proxy_status(reverse_proxy_client_t client, int status, con va_list args; va_start(args, format); char* buffer = NULL; - (void)vasprintf(&buffer, format, args); + if(vasprintf(&buffer, format, args)<0){} va_end(args); client->status_cb(client, status, buffer, client->status_cb_user_data); free(buffer); |