mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-23 01:29:34 +00:00
Add p2cstring()
This commit is contained in:
parent
58875373bb
commit
606df3c2a6
@ -69,6 +69,16 @@ unsigned char *c2pstring(char* s)
|
||||
return (unsigned char*)s;
|
||||
}
|
||||
|
||||
static char buffer[256];
|
||||
unsigned char *p2cstring(unsigned char* s)
|
||||
{
|
||||
|
||||
memcpy(buffer, s + 1, s[0]);
|
||||
buffer[(int)s[0]] = (char)0;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void error(char *x)
|
||||
{
|
||||
console_putstring("\n\n");
|
||||
|
@ -15,6 +15,7 @@ typedef unsigned int u_int32_t;
|
||||
typedef signed int int32_t;
|
||||
|
||||
extern unsigned char *c2pstring(char* s);
|
||||
extern unsigned char *p2cstring(unsigned 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