Skip to content

Commit

Permalink
fix some test scanf_s types
Browse files Browse the repository at this point in the history
  • Loading branch information
rurban committed Dec 27, 2024
1 parent 12db253 commit 9462935
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions tests/test_fscanf_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void stuff_stream(const char *dest) {
int test_fscanf_s(void) {
errno_t rc;
int32_t ind;
int i1;
size_t len1;
size_t len2;
size_t len3;
Expand Down Expand Up @@ -90,12 +91,12 @@ int test_fscanf_s(void) {
#endif

stuff_stream(" 24");
rc = fscanf_s(stream, " %d", &len1);
rc = fscanf_s(stream, " %d", &i1);
ERR(1);
ERRNO(0);
if ((int)len1 != 24) {
if (i1 != 24) {
debug_printf("%s %u wrong arg: %d\n", __FUNCTION__, __LINE__,
(int)len1);
i1);
errs++;
}

Expand Down
7 changes: 4 additions & 3 deletions tests/test_scanf_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void stuff_stdin(const char *dest) {
int test_scanf_s(void) {
errno_t rc;
int32_t ind;
int i1;
size_t len1;
size_t len2;
size_t len3;
Expand Down Expand Up @@ -99,16 +100,16 @@ int test_scanf_s(void) {
EXPSTR(str3, "24");*/

stuff_stdin(" 24");
rc = scanf_s(" %d", &len1);
rc = scanf_s(" %d", &i1);
if (rc != 1) {
printf("flapping tests - abort\n");
return errs;
}
ERR(1);
ERRNO(0);
if ((int)len1 != 24) {
if (i1 != 24) {
debug_printf("%s %u wrong arg: %d\n", __FUNCTION__, __LINE__,
(int)len1);
i1);
errs++;
}

Expand Down

0 comments on commit 9462935

Please sign in to comment.