Skip to contentSkip to conversation

kexec_tools_klibc_2.0.2: update x86_vfscanf.patch

PATCH Superseded Andrea Adami 2 participants 2 messages Jul 31, 2014 – Aug 1, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec_tools_klibc_2.0.2: update x86_vfscanf.patch

fgets in while loops is expected to check for != NULL

---
 .../recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch +1 -1
index 14f4d2a..cad6951 100644
@@ -16,7 +16,7 @@
 -	retno = vfscanf(fp, scanf_line, argptr);
 +
 +	line = xmalloc(sizeof(line) * line_size);
-+	while(fgets(line, sizeof(line), fp) != 0 ) {
++	while(fgets(line, sizeof(line), fp) != NULL ) {
 +		line_size += MAX_LINE;
 +		line = xrealloc(line,line_size);
 +	}
Signature · 1 line
1.9.1
#1 lore raw
Quoted 1 line · Andrea Adami

fgets in while loops is expected to check for != NULL

I think the message could be slightly changes, saying that fgets returns NULL on error thats why we check for NULL and not 0