Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
ee0c28e3
Commit
ee0c28e3
authored
Apr 07, 1994
by
Karl Heuer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(doprnt): Reword confusing error message.
parent
60764552
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/doprnt.c
src/doprnt.c
+4
-4
No files found.
src/doprnt.c
View file @
ee0c28e3
...
...
@@ -122,7 +122,7 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
case
'o'
:
case
'x'
:
if
(
cnt
==
nargs
)
error
(
"
Format string wants too many arguments
"
);
error
(
"
not enough arguments for format string
"
);
sprintf
(
sprintf_buffer
,
fmtcpy
,
args
[
cnt
++
]);
/* Now copy into final output, truncating as nec. */
string
=
sprintf_buffer
;
...
...
@@ -134,7 +134,7 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
{
union
{
double
d
;
char
*
half
[
2
];
}
u
;
if
(
cnt
+
1
==
nargs
)
error
(
"
Format string wants too many arguments
"
);
error
(
"
not enough arguments for format string
"
);
u
.
half
[
0
]
=
args
[
cnt
++
];
u
.
half
[
1
]
=
args
[
cnt
++
];
sprintf
(
sprintf_buffer
,
fmtcpy
,
u
.
d
);
...
...
@@ -147,7 +147,7 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
string
[
-
1
]
=
's'
;
case
's'
:
if
(
cnt
==
nargs
)
error
(
"
Format string wants too many arguments
"
);
error
(
"
not enough arguments for format string
"
);
string
=
args
[
cnt
++
];
if
(
fmtcpy
[
1
]
!=
's'
)
minlen
=
atoi
(
&
fmtcpy
[
1
]);
...
...
@@ -183,7 +183,7 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
case
'c'
:
if
(
cnt
==
nargs
)
error
(
"
Format string wants too many arguments
"
);
error
(
"
not enough arguments for format string
"
);
*
bufptr
++
=
(
int
)
args
[
cnt
++
];
bufsize
--
;
continue
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment