mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-21 08:24:10 +01:00
cd1832fe92
The intent of the previous code in that case was to force an explicit write, but the implementation was incorrect, and as a result the write was never performed. This new implementation instead uses ftruncate(2) to extend the file with a trailing hole. Also introduce regression tests for these cases. PR: 189284 (original PR whose fix introduced this bug) PR: 207092 Differential Revision: D5248 Reviewed by: sobomax,kib MFC after: 2 weeks
25 lines
336 B
C
25 lines
336 B
C
/*-
|
|
* This program is in the public domain
|
|
*
|
|
* $FreeBSD$
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int
|
|
main(int argc, char **argv)
|
|
{
|
|
int i;
|
|
|
|
if (argc > 1 && !strcmp(argv[1], "189284")) {
|
|
fputs("ABCDEFGH", stdout);
|
|
for (i = 0; i < 8; i++)
|
|
putchar(0);
|
|
} else {
|
|
for (i = 0; i < 256; i++)
|
|
putchar(i);
|
|
}
|
|
return (0);
|
|
}
|