Skip to content

Commit 079efe7

Browse files
committed
zvol_id: make array length properly known at compile time
Using strlen() in an static array declaration is a GCC extension. Clang calls it "gnu-folding-constant" and warns about it, which breaks the build. If it were widespread we could just turn off the warning, but since there's only one case, lets just change the array to an explicit size. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
1 parent ab9cbbd commit 079efe7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

udev/zvol_id.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ main(int argc, const char *const *argv)
6767
return (1);
6868
}
6969

70-
char zvol_name[MAXNAMELEN + strlen("-part") + 10];
70+
char zvol_name[MAXNAMELEN+15];
7171
if (ioctl(fd, BLKZNAME, zvol_name) == -1) {
7272
fprintf(stderr, "%s: BLKZNAME: %s\n",
7373
dev_name, strerror(errno));

0 commit comments

Comments
 (0)