summaryrefslogtreecommitdiff
path: root/minilib
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-06-25 21:57:18 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2018-06-25 21:57:18 +0200
commit3f838a994053966cdcbb1e2a32ad00801156d343 (patch)
tree15e1b646acda3616f95f4fb7fc2458a4d5ae9eca /minilib
parent93815e0c124b4f05043cf6c4c91a3f8cef17f34e (diff)
downloadcompilertests-3f838a994053966cdcbb1e2a32ad00801156d343.tar.gz
compilertests-3f838a994053966cdcbb1e2a32ad00801156d343.tar.bz2
parsing ident
Diffstat (limited to 'minilib')
-rw-r--r--minilib/string.c12
-rw-r--r--minilib/string.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/minilib/string.c b/minilib/string.c
index a3606d8..78d6010 100644
--- a/minilib/string.c
+++ b/minilib/string.c
@@ -32,6 +32,18 @@ char *strcat( char *d, char *s )
return d;
}
+char *strcat_c( char *s, int c )
+{
+ char *p;
+
+ for( p = s; *p != '\0'; p++ );
+
+ *p++ = (char)c;
+ *p = '\0';
+
+ return s;
+}
+
char *strcpy( char *d, char *s )
{
char *p;
diff --git a/minilib/string.h b/minilib/string.h
index 79f903a..cc1aa48 100644
--- a/minilib/string.h
+++ b/minilib/string.h
@@ -2,6 +2,7 @@
char *memset( void *p, int c, int n );
char *strcat( char *d, char *s );
+char *strcat_c( char *s, int c );
char *strcpy( char *d, char *s );
int strlen( char *s );
int strcmp( char *s1, char *s2 );