aboutsummaryrefslogtreecommitdiffstats
path: root/com32/gpllib
diff options
context:
space:
mode:
authorErwan Velu <erwan@enovance.com>2014-01-29 20:28:08 +0100
committerErwan Velu <erwan@enovance.com>2014-01-29 20:28:08 +0100
commit18d79b401ce15b29a5ee70cce928d231b1de032a (patch)
treef1004b283c5f9049e568affdb440114cb6541a41 /com32/gpllib
parentaca39dd5d48b49658c72220fa114438c79741476 (diff)
downloadsyslinux-18d79b401ce15b29a5ee70cce928d231b1de032a.tar.gz
syslinux-18d79b401ce15b29a5ee70cce928d231b1de032a.tar.xz
syslinux-18d79b401ce15b29a5ee70cce928d231b1de032a.zip
acpi: Removing memset of buffer
There is no need to memset the buffer since the strncat will end the string with a \0. The memset was also almost wrong as doing a sizeof() on a char * could return 1 if buff was malloc'ed. We had chance as all the current calls are done with static buffers. Removing this memset call will make things clearer but also will prevent compilation warnings like : com32/gpllib/acpi/acpi.c:38:29: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess] memset(buffer, 0, sizeof(buffer));
Diffstat (limited to 'com32/gpllib')
-rw-r--r--com32/gpllib/acpi/acpi.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/com32/gpllib/acpi/acpi.c b/com32/gpllib/acpi/acpi.c
index d2bf29e5..3013f196 100644
--- a/com32/gpllib/acpi/acpi.c
+++ b/com32/gpllib/acpi/acpi.c
@@ -35,7 +35,6 @@
/* M1PS flags have to be interpreted as strings */
char *flags_to_string(char *buffer, uint16_t flags)
{
- memset(buffer, 0, sizeof(buffer));
strcpy(buffer, "default");
if ((flags & POLARITY_ACTIVE_HIGH) == POLARITY_ACTIVE_HIGH)
strcpy(buffer, "high");