diff options
author | Peter Jones <pjones@redhat.com> | 2006-09-14 21:39:55 +0000 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2006-09-14 21:39:55 +0000 |
commit | 49e25cdcbe8d737a61cf2ad9927ef9865c5ef874 (patch) | |
tree | fbf245023a01aebfc1dcbb643823f8d05dd42d41 /loader2/modules.c | |
parent | 9e6de60524b98315b5f00400fd1bb10280add7de (diff) | |
download | anaconda-49e25cdcbe8d737a61cf2ad9927ef9865c5ef874.tar.gz anaconda-49e25cdcbe8d737a61cf2ad9927ef9865c5ef874.tar.xz anaconda-49e25cdcbe8d737a61cf2ad9927ef9865c5ef874.zip |
- use int not size_t for %n output in sscanf
Diffstat (limited to 'loader2/modules.c')
-rw-r--r-- | loader2/modules.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/loader2/modules.c b/loader2/modules.c index abe0a5939..f3aa4384f 100644 --- a/loader2/modules.c +++ b/loader2/modules.c @@ -644,7 +644,7 @@ static int removeHostAdapter(char *conf, char *name) { do { size_t n = 0; char *buf = NULL; - int d = 0; + int d = 0, m = 0; if (getline(&buf, &n, in) < 0) break; @@ -655,17 +655,16 @@ static int removeHostAdapter(char *conf, char *name) { continue; } - n = 0; if (buf[22] != ' ') - sscanf(buf+22, "%d %n", &d, &n); + sscanf(buf+22, "%d %n", &d, &m); else - sscanf(buf+22, " %n", &n); + sscanf(buf+22, " %n", &m); if (!ret) { - if (strncmp(buf+22+n, name, strlen(name))) { + if (strncmp(buf+22+m, name, strlen(name))) { if (nhbas) - fprintf(out, "alias scsi_hostadapter%d %s", nhbas, buf+22+n); + fprintf(out, "alias scsi_hostadapter%d %s", nhbas, buf+22+m); else - fprintf(out, "alias scsi_hostadapter %s", buf+22+n); + fprintf(out, "alias scsi_hostadapter %s", buf+22+m); nhbas++; } else { logMessage(INFO, "removed usb-storage from modprobe.conf"); |