Listing 1: Rsyslog [...] int i; /* general index for parsing */ uchar bufParseTAG[CONF_TAG_MAXSIZE]; uchar bufParseHOSTNAME[CONF_HOSTNAME_MAXSIZE]; [...] while(lenMsg > 0 && *p2parse != ':' && *p2parse != ' ' && i < CONF_TAG_MAXSIZE) { bufParseTAG[i++] = *p2parse++; --lenMsg; } if(lenMsg > 0 && *p2parse == ':') { ++p2parse; --lenMsg; bufParseTAG[i++] = ':'; } [...] bufParseTAG[i] = '\0'; /* terminate string */ Listing 2: imap/nntpd.c do { if ((c = strrchr(str, ','))) *c++ = '\0'; else c = str; if (!(n % 10)) /* alloc some more */ wild = xrealloc(wild, (n + 11) * sizeof(struct wildmat)); if (*c == '!') wild[n].not = 1; /* not */ else if (*c == '@') wild[n].not = -1; /* absolute not (feeding) */ else wild[n].not = 0; strcpy(p, wild[n].not ? c + 1 : c); wild[n++].pat = xstrdup(pattern); } while (c != str);