summaryrefslogtreecommitdiff
path: root/ulib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ulib.c')
-rw-r--r--ulib.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ulib.c b/ulib.c
index 004b934..c6c7f19 100644
--- a/ulib.c
+++ b/ulib.c
@@ -20,6 +20,14 @@ strcpy(char *s, char *t)
return os;
}
+int
+strcmp(const char *p, const char *q)
+{
+ while (*p && *p == *q)
+ p++, q++;
+ return (int) ((unsigned char) *p - (unsigned char) *q);
+}
+
unsigned int
strlen(char *s)
{
@@ -41,6 +49,15 @@ memset(void *dst, int c, unsigned int n)
}
char *
+strchr(const char *s, char c)
+{
+ for (; *s; s++)
+ if (*s == c)
+ return (char *) s;
+ return 0;
+}
+
+char *
gets(char *buf, int max)
{
int i = 0, cc;