dasdinfo/dasdinfo.c: Fix string termination

Use correct buffer and index to terminate string returned by readlink().

Reviewed-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Jan Polensky
2025-09-15 15:01:14 +02:00
committed by Jan Höppner
parent 538bc7b4e8
commit 8a88ada9c5

View File

@@ -393,7 +393,7 @@ dinfo_is_busiddir(const char *fpath, const struct stat *UNUSED(sb),
if (i < 0 || i >= LINK_DIR_SIZE)
return -1;
/* append '\0' because readlink returns non zero terminated string */
tempdir[i + 1] = '\0';
linkdir[i] = '\0';
if (strstr(linkdir, "dasd") == NULL)
return FTW_CONTINUE;
free(busiddir);