Rev 521 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 521 | Rev 522 | ||
---|---|---|---|
Line 19... | Line 19... | ||
19 | */ |
19 | */ |
20 | 20 | ||
21 | #include "ff.h" |
21 | #include "ff.h" |
22 | 22 | ||
23 | void strcpy_advance_id(TCHAR** str, int msgid) { |
23 | void strcpy_advance_id(TCHAR** str, int msgid) { |
24 | //TCHAR tmp[1000]; |
- | |
25 | int len; |
- | |
26 | - | ||
27 | len = FF_GetMsg(*str, msgid); |
24 | int len = FF_GetMsg(*str, msgid); |
28 | - | ||
29 | *str += len; |
25 | *str += len; |
30 | - | ||
31 | //FF_GetMsg(&tmp[0], msgid); |
- | |
32 | //len = xstrlen(&tmp[0]); |
- | |
33 | if (len == 0) { |
- | |
34 | simplealert(TEXT("strcpy_advance_id ist len=0!")); |
- | |
35 | } |
- | |
36 | - | ||
37 | } |
26 | } |
38 | 27 | ||
39 | // Attention: No bounds checking! |
28 | // Attention: No bounds checking! |
40 | int FF_GetMsg(TCHAR* ret, int MsgId) { |
29 | int FF_GetMsg(TCHAR* ret, int MsgId) { |
41 | #ifdef WIN_ENV |
30 | #ifdef WIN_ENV |
Line 74... | Line 63... | ||
74 | } |
63 | } |
75 | 64 | ||
76 | // Attention: Requires FF_GetMsg_Free(), otherwise memory is leaked |
65 | // Attention: Requires FF_GetMsg_Free(), otherwise memory is leaked |
77 | TCHAR* FF_GetMsg_Cpy(int MsgId) { |
66 | TCHAR* FF_GetMsg_Cpy(int MsgId) { |
78 | #ifdef WIN_ENV |
67 | #ifdef WIN_ENV |
79 | TCHAR* szMsg; |
- | |
80 | int len; |
68 | int len; |
81 | TCHAR* ret; |
69 | TCHAR* ret; |
82 | len = FF_GetMsg(NULL, MsgId); |
70 | len = FF_GetMsg(NULL, MsgId); |
83 | if (len == 0) return NULL; // resource not found |
71 | if (len == 0) return NULL; // resource not found |
84 | ret = (TCHAR*)malloc((len+1) * sizeof(TCHAR)); |
72 | ret = (TCHAR*)malloc((len+1) * sizeof(TCHAR)); |