strlen function


strlen will give you the length of a string, NOT including the '\0' terminator. It should not be confused with the sizeof operator which returns the size of a variable (that could hold a string).

Library:   string.h

Prototype: size_t strlen(const char *s);

Syntax:	   size_t size;
	   char string[20]="red dwarf";
           size = strlen(string);

Examples

Example program.

See Also

strlen man page.

sizeof operator.

lenstr - User written version of strlen.


Top Master Index Keywords Functions


Martin Leslie

summaryrefslogtreecommitdiff

diff options
context:
space:
mode:
authorNogah Frankel <nogahf@mellanox.com>2017-02-09 14:54:46 +0100
committerDavid S. Miller <davem@davemloft.net>2017-02-10 11:46:40 -0500
commit71c365bdc4396893798c8e1c9247663096ff4829 (patch)
tree3e64620d399cb4bfb3db580d40b67b180e307b65
parent63fe813c6008b5a10a06bffd64cee8da2984e716 (diff)
mlxsw: spectrum: Separate bc and mc floods
Break the bm (broadcast-multicast) into two tables, one for broadcast (and link local multicast that behaves like bc) and one for unknown multicasts. Add a bool into mlxsw_sp_port named mc_flood that reflect the value this port should have in the mc flood table (currently, always 1); Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.c23
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.h4
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c21
3 files changed, 35 insertions, 13 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c