Ticket #236: strnlen.patch

File strnlen.patch, 1.2 KB (added by Eric Norum, on 12/03/06 at 13:31:12)

strnlen.patch

  • c/src/libnetworking/rtems_webserver/misc.c

    strnlen.patch#¹<’¹<’ÓmBIN‚/Šdiff -ur /tmp/rtems-ss-20020528.orig/c/src/libnetworking/rtems_webserver/misc.c rtems-ss-20020528/c/src/libnetworking/rtems_webserver/misc.c
    old new  
    4949
    5050static int      dsnprintf(char_t **s, int size, char_t *fmt, va_list arg,
    5151                                int msize);
    52 static int      strnlen(char_t *s, unsigned int n);
    5352static void     put_char(strbuf_t *buf, char_t c);
    5453static void     put_string(strbuf_t *buf, char_t *s, int len,
    5554                                int width, int prec, enum flag f);
     
    405404                return buf.size;
    406405        }
    407406        return buf.count;
    408 }
    409 
    410 /******************************************************************************/
    411 /*
    412  *      Return the length of a string limited by a given length
    413  */
    414 
    415 static int strnlen(char_t *s, unsigned int n)
    416 {
    417         unsigned int    len;
    418 
    419         len = gstrlen(s);
    420         return min(len, n);
    421407}
    422408
    423409/******************************************************************************/