- strncpy( TheMask, Pattern, MASK_LEN - 4 );
- TheMask[MASK_LEN - 4] = '\0';
- strcat( TheMask, "!*@" );
- strncat( TheMask, at, strlen( TheMask ) - MASK_LEN - 1 );
- TheMask[MASK_LEN - 1] = '\0';
+ strlcpy( TheMask, Pattern, sizeof( TheMask ) - strlen( at ) - 4 );
+ strlcat( TheMask, "!*@", sizeof( TheMask ));
+ strlcat( TheMask, at, sizeof( TheMask ));