mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
perf, ui: Eliminate stack-smashing protection compiler complaint
The gcc complains about small auto-var strings being allocated from stack space. Make them const to avoid this: | CC util/ui/util.o | cc1: warnings being treated as errors | util/ui/util.c: In function ‘ui__dialog_yesno’: | util/ui/util.c:108: error: not protecting function: no buffer at least 8 bytes long | make: *** [util/ui/util.o] Error 1 The real bug is in the newtWinChoice() ABI - but that's an externality we cannot fix here, so we use this workaround. Signed-off-by: Cyrill Gorcunov <[email protected]> Acked-by: Frédéric Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> LKML-Reference: <20101106084724.GA5956@lenovo> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
f6614b7bb4
commit
a3da8e4513
1 changed files with 3 additions and 2 deletions
|
|
@ -104,9 +104,10 @@ out_destroy_form:
|
|||
return rc;
|
||||
}
|
||||
|
||||
static const char yes[] = "Yes", no[] = "No";
|
||||
|
||||
bool ui__dialog_yesno(const char *msg)
|
||||
{
|
||||
/* newtWinChoice should really be accepting const char pointers... */
|
||||
char yes[] = "Yes", no[] = "No";
|
||||
return newtWinChoice(NULL, yes, no, (char *)msg) == 1;
|
||||
return newtWinChoice(NULL, (char *)yes, (char *)no, (char *)msg) == 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue