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
|
|
49 | 49 | |
50 | 50 | static int dsnprintf(char_t **s, int size, char_t *fmt, va_list arg, |
51 | 51 | int msize); |
52 | | static int strnlen(char_t *s, unsigned int n); |
53 | 52 | static void put_char(strbuf_t *buf, char_t c); |
54 | 53 | static void put_string(strbuf_t *buf, char_t *s, int len, |
55 | 54 | int width, int prec, enum flag f); |
… |
… |
|
405 | 404 | return buf.size; |
406 | 405 | } |
407 | 406 | 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); |
421 | 407 | } |
422 | 408 | |
423 | 409 | /******************************************************************************/ |