2017-10-21 18:40:19 -05:00
|
|
|
/* Deviance Test 17.3.0.3: Ensure illegal setvbuf calls are detected */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2022-10-17 17:50:42 -05:00
|
|
|
int main (void)
|
2017-10-21 18:40:19 -05:00
|
|
|
{
|
|
|
|
FILE *f1;
|
|
|
|
char buf [80];
|
|
|
|
int i;
|
|
|
|
|
|
|
|
f1 = fopen ("3/tmp", "w"); /* call setvbuf with an ivalid buffering type */
|
|
|
|
if (f1 == NULL)
|
|
|
|
goto Fail1;
|
|
|
|
i = setvbuf (f1, buf, 3, 80);
|
|
|
|
if (!i)
|
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
printf ("Passed Deviance Test 17.3.0.3\n");
|
2022-10-17 17:50:42 -05:00
|
|
|
return 0;
|
2017-10-21 18:40:19 -05:00
|
|
|
|
|
|
|
Fail:
|
|
|
|
printf ("Failed Deviance Test 17.3.0.3\n");
|
2022-10-17 17:50:42 -05:00
|
|
|
return 0;
|
2017-10-21 18:40:19 -05:00
|
|
|
|
|
|
|
Fail1:
|
|
|
|
printf ("Unable to open work file for Deviance Test 17.3.0.3\n");
|
2022-10-17 17:50:42 -05:00
|
|
|
return 0;
|
2017-10-21 18:40:19 -05:00
|
|
|
}
|