mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 14:26:21 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user