-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstr.c
More file actions
45 lines (38 loc) · 682 Bytes
/
Copy pathstr.c
File metadata and controls
45 lines (38 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
void writestring(const char* st, unsigned int* map, unsigned int p, unsigned int offset)
{
unsigned int sp = p; /* start position */
unsigned int c;
while((c = *st))
{
if(c == '\n')
{
sp += 0x20;
p = sp;
}
else
{
map[p] = c + offset;
p++;
}
st++;
}
}
void writenum(unsigned long long num, unsigned char len, unsigned int* map, unsigned int p, unsigned int offset)
{
unsigned char figure;
p += len - 1;
if(!num)
{
map[p] = offset;
}
else
while(len && num)
{
figure = num % 10;
if(num || figure)
map[p] = figure + offset;
num /= 10;
p--;
len--;
}
}