partitions: fix build error in ibm partition detection code
PATCH 1/1 partitions: fix build error in ibm partition detection code
Subject: [PATCH] partitions: fix build error in ibm partition detection code
From: Heiko Carstens <[email protected]>
9c867fbe "partitions: fix sometimes unreadable partition strings" coverted one line within the ibm partition code incorrectly. Fix this to get rid of a build error.
fs/partitions/ibm.c: In function 'ibm_partition':
[...]fs/partitions/ibm.c:185: error: too many arguments to function 'strlcat'
--- fs/partitions/ibm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/partitions/ibm.c +2 -1
@@ -182,7 +182,8 @@ int ibm_partition(struct parsed_partitions *state) offset = (info->label_block +1 ); }else {/* unlabeled disk */ -strlcat (tmp,sizeof (tmp),"(nonl)" ,PAGE_SIZE ); +snprintf (tmp,sizeof (tmp),"(nonl)" ); +strlcat (state->pp_buf, tmp,PAGE_SIZE ); size = i_size >>9 ; offset = (info->label_block +1 ); }
fs/partitions/ibm.c int ibm_partition(struct parsed_partitions *state) · line 186
Quoted 3 lines · Heiko Carstens
fs/partitions/ibm.c +2
-1-strlcat (tmp,sizeof (tmp),"(nonl)" ,PAGE_SIZE ); +snprintf (tmp,sizeof (tmp),"(nonl)" ); +strlcat (state->pp_buf, tmp,PAGE_SIZE );
What's the point of tmp and snprintf if it just creates a copy of a constant string?
strlcat(state->pp_buf, "(nonl)", PAGE_SIZE);
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."
Quoted 10 lines · Andreas Schwab
Review
Quoted 3 lines · Heiko Carstens
(quoted diff) +2
-1- strlcat(tmp, sizeof(tmp), "(nonl)", PAGE_SIZE); + snprintf(tmp, sizeof(tmp), "(nonl)"); + strlcat(state->pp_buf, tmp, PAGE_SIZE);What's the point of tmp and snprintf if it just creates a copy of a constant string?
strlcat(state->pp_buf, "(nonl)", PAGE_SIZE);
There's no point, just followed the pattern in the original patch without thinking. Thanks! Updated patch:
Subject: [PATCH] partitions: fix build error in ibm partition detection code
From: Heiko Carstens <[email protected]>
9c867fbe "partitions: fix sometimes unreadable partition strings" coverted one line within the ibm partition code incorrectly. Fix this to get rid of a build error.
fs/partitions/ibm.c: In function 'ibm_partition':
[...]fs/partitions/ibm.c:185: error: too many arguments to function 'strlcat'
--- fs/partitions/ibm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/partitions/ibm.c +1 -1
@@ -182,7 +182,7 @@ int ibm_partition(struct parsed_partitio offset = (info->label_block +1 ); }else {/* unlabeled disk */ -strlcat (tmp,sizeof (tmp),"(nonl)" ,PAGE_SIZE ); +strlcat (state->pp_buf,"(nonl)" ,PAGE_SIZE ); size = i_size >>9 ; offset = (info->label_block +1 ); }