aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk
diff options
context:
space:
mode:
authorShao Miller <shao.miller@yrdsb.edu.on.ca>2009-12-11 19:53:16 +0100
committerErwan Velu <erwan.velu@free.fr>2009-12-11 19:53:16 +0100
commitcd5188bc5c189b6d374ccd4cd5eeba0d9f718ae1 (patch)
tree28de52b1cbd09bd5ab103789f5777b138ad0bdd7 /memdisk
parent50e8504edee547ad9c9e8900550ec5c85b77435e (diff)
downloadsyslinux.git-cd5188bc5c189b6d374ccd4cd5eeba0d9f718ae1.tar.gz
syslinux.git-cd5188bc5c189b6d374ccd4cd5eeba0d9f718ae1.tar.xz
syslinux.git-cd5188bc5c189b6d374ccd4cd5eeba0d9f718ae1.zip
memdisk: Fix "might be used uninitialized" warning
Impact: Initializing variables The checksum_buf function was providing an incorrect checksum on at least one build.
Diffstat (limited to 'memdisk')
-rw-r--r--memdisk/setup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/memdisk/setup.c b/memdisk/setup.c
index ea17afda..b8eadfb7 100644
--- a/memdisk/setup.c
+++ b/memdisk/setup.c
@@ -592,7 +592,7 @@ static const struct geometry *get_disk_image_geometry(uint32_t where,
while (!ok) {
/* Assume it's a floppy drive, guess a geometry */
unsigned int type, track;
- int c, h, s;
+ int c, h, s = 0;
if (xsectors < 320 * 2) {
c = 40;
@@ -795,7 +795,7 @@ static void relocate_rm_code(uint32_t newbase)
static uint8_t checksum_buf(const void *buf, int count)
{
const uint8_t *p = buf;
- uint8_t c;
+ uint8_t c = 0;
while (count--)
c += *p++;