On 1/6/06, Han Boetes <[EMAIL PROTECTED]> wrote:
> Theo de Raadt wrote:
> > On some other systems, yes. On OpenBSD -- today -- it cannot return -1.
> >
> > However, that is absolutely no excuse to go writing unportable code.
> >
> > You must check for either ret > buflen or ret == -1 being a failu
Theo de Raadt wrote:
> On some other systems, yes. On OpenBSD -- today -- it cannot return -1.
>
> However, that is absolutely no excuse to go writing unportable code.
>
> You must check for either ret > buflen or ret == -1 being a failure
> condition.
Wrong! Will you ever learn to code something
Theo de Raadt wrote:
I'm having trouble making snprintf return -1. I've tried stuff like:
len = snprintf(str, 0, "%.-Z\n", 9);
printf("%d", len);
but that just prints `2'. Does snprintf ever return -1?
The "new" snprintf() returns -1 on ``output or encoding error'', as was
Otto Moerbeek wrote:
On Thu, 5 Jan 2006, veins wrote:
I'm having trouble making snprintf return -1. I've tried stuff like:
len = snprintf(str, 0, "%.-Z\n", 9);
printf("%d", len);
but that just prints `2'. Does snprintf ever return -1?
-Ray-
you might want to ta
In message <[EMAIL PROTECTED]>
so spake Ray Lai (ray):
> I'm having trouble making snprintf return -1. I've tried stuff like:
>
> len = snprintf(str, 0, "%.-Z\n", 9);
> printf("%d", len);
>
> but that just prints `2'. Does snprintf ever return -1?
Not on OpenBSD. It can o
On Thu, 5 Jan 2006, veins wrote:
> > I'm having trouble making snprintf return -1. I've tried stuff like:
> >
> > len = snprintf(str, 0, "%.-Z\n", 9);
> > printf("%d", len);
> >
> > but that just prints `2'. Does snprintf ever return -1?
> >
> > -Ray-
> >
> you might want to take a
I'm having trouble making snprintf return -1. I've tried stuff like:
len = snprintf(str, 0, "%.-Z\n", 9);
printf("%d", len);
but that just prints `2'. Does snprintf ever return -1?
-Ray-
you might want to take a look at how vfprintf() is implemented in
/usr/src/lib/libc
> According to printf(3):
>
> snprintf() and vsnprintf() will write at most size-1 of the characters
> printed into the output string (the size'th character then gets the ter-
> minating `\0'); if the return value is greater than or equal to the size
> argument, the string
According to printf(3):
snprintf() and vsnprintf() will write at most size-1 of the characters
printed into the output string (the size'th character then gets the ter-
minating `\0'); if the return value is greater than or equal to the size
argument, the string was
9 matches
Mail list logo