19 lines · 356 B · C
RawDownload
#include <u.h>#include <libc.h>#include "String.h"  /* return a String containing a copy of the passed char array */extern String*s_copy(char *cp){	String *sp;	int len; 	len = strlen(cp)+1;	sp = s_newalloc(len);	setmalloctag(sp, getcallerpc(&cp));	strcpy(sp->base, cp);	sp->ptr = sp->base + len - 1;		/* point to 0 terminator */	return sp;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t