MBLEN(3) Linux Programmer's Manual MBLEN(3)

NAME

mblen - determine the number of bytes in a character

SYNOPSIS

#include <stdlib.h> int mblen(const char *s, size_t n);

DESCRIPTION

The mblen() function scans the first n bytes of the string s and returns the number of bytes in a character. The mblen() function is equivalent to mbtowc((wchat_t *)0, s, n); except that the shift state of the mbtowc() function is not affected.

RETURN VALUE

The mblen() returns the number of bytes in a character or -1 if the character is invalid or 0 if s is a NULL string.

CONFORMING TO

SVID 3, ISO 9899

SEE ALSO

mbstowcs, mbtowc, wcstombs, wctomb,































GNU March 29, 1993 1


Top Master Index Keywords Functions


This manual page was brought to you by mjl_man V-2.0 gi/linux/net-next.git/?h=nds-private-remove'>summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2016-09-26 14:14:53 +0200
committerMark Brown <broonie@kernel.org>2016-09-26 09:08:46 -0700
commitf13d4e189d209af0f552e9900acd06ee4a35e601 (patch)
treefd296df6645eb783150cac054f698331504a6980
parent15ca92156e6242060dff91c8d8e7fe7ae82d424a (diff)
spi: imx: Gracefully handle NULL master->cs_gpios
It is possible that master->cs_gpios is NULL after spi_bitbang_start(), this happens if the master has no CS GPIOs specified in DT. Check for this case after spi_bitbang_start() to prevent NULL pointer dereference in the subsequent for loop, which accesses the master->cs_gpios field. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Martin Kaiser <martin@kaiser.cx> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat