[syslinux:elflink] pxe: Fix compiler warnings and real bug

syslinux-bot for Matt Fleming matt.fleming at intel.com
Wed Mar 20 08:36:03 PDT 2013


Commit-ID:  a107cb3b6fa219cf5f65bef366c9b00b108e9a3a
Gitweb:     http://www.syslinux.org/commit/a107cb3b6fa219cf5f65bef366c9b00b108e9a3a
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Wed, 20 Mar 2013 15:22:40 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Wed, 20 Mar 2013 15:28:52 +0000

pxe: Fix compiler warnings and real bug

commit 00a6f13139 ("Partially revert "pxe: Pass absolute path to
pxe_chdir()"") introduced a bug by comparing the function 'url_type'
with URL_SUFFIX. This resulted in the following warning,

fs/pxe/pxe.c: In function ‘pxe_chdir’:
fs/pxe/pxe.c:460:18: warning: comparison between pointer and integer [enabled by default]
fs/pxe/pxe.c:458:19: warning: unused variable ‘path_type’ [-Wunused-variable]
fs/pxe/pxe.c: In function ‘pxe_chdir’:
fs/pxe/pxe.c:460:18: warning: comparison between pointer and integer [enabled by default]
fs/pxe/pxe.c:458:19: warning: unused variable ‘path_type’ [-Wunused-variable]

which unfortunately went unnoticed.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 core/fs/pxe/pxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index 3e90336..4d694a1 100644
--- a/core/fs/pxe/pxe.c
+++ b/core/fs/pxe/pxe.c
@@ -457,7 +457,7 @@ static int pxe_chdir(struct fs_info *fs, const char *src)
     /* The cwd for PXE is just a text prefix */
     enum url_type path_type = url_type(src);
 
-    if (url_type == URL_SUFFIX)
+    if (path_type == URL_SUFFIX)
 	strlcat(fs->cwd_name, src, sizeof fs->cwd_name);
     else
 	strlcpy(fs->cwd_name, src, sizeof fs->cwd_name);


More information about the Syslinux-commits mailing list