Using alloca() for a constant sized buffer is very silly.
Cppcheck said using alloca() in the 21st century is silly anyway.
This commit is contained in:
parent
b355476e91
commit
ade4fccad6
1 changed files with 1 additions and 1 deletions
|
|
@ -393,7 +393,7 @@ char *get_name(void) {
|
||||||
logger(DEBUG_ALWAYS, LOG_ERR, "Invalid Name: environment variable %s does not exist\n", name + 1);
|
logger(DEBUG_ALWAYS, LOG_ERR, "Invalid Name: environment variable %s does not exist\n", name + 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
envname = alloca(32);
|
char envname[32];
|
||||||
if(gethostname(envname, 32)) {
|
if(gethostname(envname, 32)) {
|
||||||
logger(DEBUG_ALWAYS, LOG_ERR, "Could not get hostname: %s\n", strerror(errno));
|
logger(DEBUG_ALWAYS, LOG_ERR, "Could not get hostname: %s\n", strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue