kexec_tools_klibc_2.0.2: update x86_vfscanf.patch
PATCH 1/1 kexec_tools_klibc_2.0.2: update x86_vfscanf.patch
fgets in while loops is expected to check for != NULL
Signed-off-by Andrea Adami <[email protected]>
--- .../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
@@ -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
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