On 05/07/2015 05:00 AM, Dan Carpenter wrote:
On Wed, May 06, 2015 at 06:45:56PM +0200, Geert Uytterhoeven wrote:
On Wed, May 6, 2015 at 5:59 PM, Dan Carpenter wrote:
We actually do have a __must_check tag so it's easy enough to force
people to check. A different option is we could make it
On Wed, May 06, 2015 at 06:45:56PM +0200, Geert Uytterhoeven wrote:
> On Wed, May 6, 2015 at 5:59 PM, Dan Carpenter
> wrote:
> > We actually do have a __must_check tag so it's easy enough to force
> > people to check. A different option is we could make it trigger a
>
> People tend to ignore
On Wed, May 06, 2015 at 06:45:56PM +0200, Geert Uytterhoeven wrote:
On Wed, May 6, 2015 at 5:59 PM, Dan Carpenter dan.carpen...@oracle.com
wrote:
We actually do have a __must_check tag so it's easy enough to force
people to check. A different option is we could make it trigger a
People
On 05/07/2015 05:00 AM, Dan Carpenter wrote:
On Wed, May 06, 2015 at 06:45:56PM +0200, Geert Uytterhoeven wrote:
On Wed, May 6, 2015 at 5:59 PM, Dan Carpenter dan.carpen...@oracle.com wrote:
We actually do have a __must_check tag so it's easy enough to force
people to check. A different
On Wed, May 6, 2015 at 5:59 PM, Dan Carpenter wrote:
> We actually do have a __must_check tag so it's easy enough to force
> people to check. A different option is we could make it trigger a
People tend to ignore compiler warnings...
> WARN_ONCE().
>
> #define strXcpy(dest, src, len) (({
We actually do have a __must_check tag so it's easy enough to force
people to check. A different option is we could make it trigger a
WARN_ONCE().
#define strXcpy(dest, src, len) (({ \
ssize_t __ret = strscpy_truncate(dest, src, len); \
On 5/6/2015 11:01 AM, Dan Carpenter wrote:
On Thu, Apr 30, 2015 at 12:01:16PM -0400, Chris Metcalf wrote:
>+ssize_t strscpy(char *dest, const char *src, size_t count)
>+{
>+ ssize_t res = strscpy_truncate(dest, src, count);
>+ if (res < 0 && count != 0)
>+ dest[0] = '\0';
How is
On Thu, Apr 30, 2015 at 12:01:16PM -0400, Chris Metcalf wrote:
> +ssize_t strscpy(char *dest, const char *src, size_t count)
> +{
> + ssize_t res = strscpy_truncate(dest, src, count);
> + if (res < 0 && count != 0)
> + dest[0] = '\0';
How is this better than returning a
On Wed, May 6, 2015 at 5:59 PM, Dan Carpenter dan.carpen...@oracle.com wrote:
We actually do have a __must_check tag so it's easy enough to force
people to check. A different option is we could make it trigger a
People tend to ignore compiler warnings...
WARN_ONCE().
#define strXcpy(dest,
On 5/6/2015 11:01 AM, Dan Carpenter wrote:
On Thu, Apr 30, 2015 at 12:01:16PM -0400, Chris Metcalf wrote:
+ssize_t strscpy(char *dest, const char *src, size_t count)
+{
+ ssize_t res = strscpy_truncate(dest, src, count);
+ if (res 0 count != 0)
+ dest[0] = '\0';
How is this
On Thu, Apr 30, 2015 at 12:01:16PM -0400, Chris Metcalf wrote:
+ssize_t strscpy(char *dest, const char *src, size_t count)
+{
+ ssize_t res = strscpy_truncate(dest, src, count);
+ if (res 0 count != 0)
+ dest[0] = '\0';
How is this better than returning a truncated
We actually do have a __must_check tag so it's easy enough to force
people to check. A different option is we could make it trigger a
WARN_ONCE().
#define strXcpy(dest, src, len) (({ \
ssize_t __ret = strscpy_truncate(dest, src, len); \
The strscpy() API is intended to be used instead of strlcpy(),
and instead of most uses of strncpy().
- The API provides an easy way to check for destination buffer overflow:
a -E2BIG error return value.
- By default, truncation causes the destination buffer to be the
empty string, so users
The strscpy() API is intended to be used instead of strlcpy(),
and instead of most uses of strncpy().
- The API provides an easy way to check for destination buffer overflow:
a -E2BIG error return value.
- By default, truncation causes the destination buffer to be the
empty string, so users
14 matches
Mail list logo