]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: remove last remaining assert() master
authorPádraig Brady <P@draigBrady.com>
Thu, 9 Apr 2026 20:36:12 +0000 (21:36 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 9 Apr 2026 20:36:43 +0000 (21:36 +0100)
* src/split.c (bytes_chunk_extract): Prefer affirm to assert,
as it allows for better static checking when compiling with -DNDEBUG.

src/split.c

index 4786df8279478e8ba65b77892535a6855a26d48a..a8e6f8bf5f4053f56bc41e545197b8d82f468146 100644 (file)
@@ -1071,7 +1071,7 @@ bytes_chunk_extract (intmax_t k, intmax_t n, char *buf, idx_t bufsize,
   off_t start;
   off_t end;
 
-  assert (0 < k && k <= n);
+  affirm (0 < k && k <= n);
 
   start = (k - 1) * (file_size / n) + MIN (k - 1, file_size % n);
   end = k == n ? file_size : k * (file_size / n) + MIN (k, file_size % n);