mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 19:46: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,7 +35,6 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -315,11 +314,13 @@ _autocomplete_param_common(const char* const input, char* command, autocomplete_
|
||||
char* result = NULL;
|
||||
int len;
|
||||
|
||||
len = asprintf(&command_cpy, "%s ", command);
|
||||
if (len == -1) {
|
||||
command_cpy = g_strdup_printf("%s ", command);
|
||||
if (!command_cpy) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
len = strlen(command_cpy);
|
||||
|
||||
if (strncmp(input, command_cpy, len) == 0) {
|
||||
int inp_len = strlen(input);
|
||||
char prefix[inp_len];
|
||||
|
||||
Reference in New Issue
Block a user