unsigned *copy_until( const unsigned *src, unsigned *dst, unsigned n, unsigned delim ) { while ( n-- ) { if ( *src == delim ) break; *dst++ = *src++; } return dst; }