projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2260ed0
)
Using alloca() for a constant sized buffer is very silly.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 10 Nov 2012 22:13:05 +0000
(23:13 +0100)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 14 Nov 2012 10:12:55 +0000
(11:12 +0100)
Cppcheck said using alloca() in the 21st century is silly anyway.
src/net_setup.c
patch
|
blob
|
history
diff --git
a/src/net_setup.c
b/src/net_setup.c
index
3e435dd
..
ddb0bcf
100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-299,7
+299,7
@@
char *get_name(void) {
fprintf(stderr, "Invalid Name: environment variable %s does not exist\n", name + 1);
return false;
}
-
envname = alloca(32)
;
+
char envname[32]
;
if(gethostname(envname, 32)) {
fprintf(stderr, "Could not get hostname: %s\n", strerror(errno));
return false;