Re: [PATCH] Add compat/vsnprintf.c for systems that returns -1 on maxsize reached

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michal Rokos schrieb:
> HP-UX B.11.11 9000/800
> case1: -1
> case2: -1
> case3: 5
> case4: 5
> 
> HP-UX B.11.23 ia64
> case1: -1
> case2: -1
> case3: 5
> case4: 5
> 
> So HPUX impl is the same as a Windows one. So we can share the replacement.
> Please note that there's no va_copy() on HPUX.

It's not the same on Windows, which returns:

case1: -1
case2: 5
case3: 5
case4: 5

IOW, HPUX et.al. take the *size* of the buffer, whereas Windows takes the
maximal number of characters to write excluding NUL.

Which means that we need another configuration variable on Windows:

  -DSNPRINTF_SIZE_CORR=1

and

#ifndef SNPRINTF_SIZE_CORR
#define SNPRINTF_SIZE_CORR 0
#endif

in the replacement implementation. But I can do this myself in the course
of the MinGW port.

BTW, this is not only an issue of vsnprintf, but also of snprintf!

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux