mobile/gsm322.c: prevent calling memset() with zero length
This change prevents a possibility of calling memset() with constant zero length parameter, and the corresponding compiler warning. Change-Id: I2d8d78474614939659a7f24d5007b1c890776b1a
This commit is contained in:
parent
52fbe66ca7
commit
43ecde0fce
|
@ -320,6 +320,10 @@ static char *bargraph(int value, int min, int max)
|
|||
else
|
||||
value -= min;
|
||||
|
||||
/* Prevent calling memset() with zero length */
|
||||
if (value == 0)
|
||||
return "";
|
||||
|
||||
memset(bar, '=', value);
|
||||
bar[value] = '\0';
|
||||
|
||||
|
|
Loading…
Reference in New Issue