Skip to content

Commit b1a9803

Browse files
committed
Packages: fix -Wstringop-overflow warning
1 parent a1bf014 commit b1a9803

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/modules/packages/packages.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ bool ffPrintPackages(FFPackagesOptions* options) {
135135
FF_PRINT_PACKAGE(xbps)
136136

137137
assert(output.length >= 2); // counts.all > 0 guarantees that at least one package count was printed, which guarantees that ", " was appended at least once
138-
ffStrbufSubstrBefore(&output, output.length - 1);
139-
output.chars[output.length - 1] = '\n';
138+
ffStrbufSubstrBefore(&output, output.length - 2);
139+
ffStrbufAppendC(&output, '\n');
140140
ffStrbufWriteTo(&output, stdout);
141141
} else {
142142
FF_PRINT_FORMAT_CHECKED(FF_PACKAGES_MODULE_NAME,

0 commit comments

Comments
 (0)