mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-02 21:30:29 +00:00
Add string conversion function from C string to pascal string
This commit is contained in:
parent
574e8bdd9d
commit
df7b2625d1
@ -48,6 +48,18 @@ char *strncpy (char *__restrict __dest,
|
||||
return __dest;
|
||||
}
|
||||
|
||||
unsigned char *c2pstring(char* s)
|
||||
{
|
||||
int len = strlen(s);
|
||||
int i;
|
||||
|
||||
for (i = len; i > 0; i--)
|
||||
s[i] = s[i - 1];
|
||||
s[0] = len;
|
||||
|
||||
return (unsigned char*)s;
|
||||
}
|
||||
|
||||
void error(char *x)
|
||||
{
|
||||
printf("\n\n");
|
||||
|
@ -11,5 +11,6 @@ typedef signed short int16_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
typedef signed int int32_t;
|
||||
|
||||
extern unsigned char *c2pstring(char* s);
|
||||
extern void memdump(unsigned char* addr, unsigned long size);
|
||||
extern void error(char *x) __attribute__ ((noreturn));
|
||||
|
Loading…
Reference in New Issue
Block a user