Get rid of asprintf and _GNU_SOURCE define

_GNU_SOURCE was even in some files where it was not needed at all
(http*).

Let's replace asprintf() with g_strdup_printf().
This commit is contained in:
Michael Vetter
2021-03-30 17:38:13 +02:00
parent 3c1e4bac3a
commit 1ec606540e
12 changed files with 97 additions and 104 deletions

View File

@@ -35,8 +35,6 @@
*
*/
#define _GNU_SOURCE 1
#include "config.h"
#include <string.h>
@@ -141,10 +139,10 @@ cmd_process_input(ProfWin* window, char* inp)
char* question_mark = strchr(command, '?');
if (question_mark) {
*question_mark = '\0';
char* fakeinp;
if (asprintf(&fakeinp, "/help %s", command + 1)) {
gchar* fakeinp = g_strdup_printf("/help %s", command + 1);
if (fakeinp) {
result = _cmd_execute(window, "/help", fakeinp);
free(fakeinp);
g_free(fakeinp);
}
} else {
result = _cmd_execute(window, command, inp);