… | |
… | |
140 | #undef def |
140 | #undef def |
141 | #undef def2 |
141 | #undef def2 |
142 | |
142 | |
143 | shstr skill_names[NUM_SKILLS]; |
143 | shstr skill_names[NUM_SKILLS]; |
144 | |
144 | |
145 | //TODO: this should of course not be here |
|
|
146 | |
|
|
147 | /* buf_overflow() - we don't want to exceed the buffer size of |
|
|
148 | * buf1 by adding on buf2! Returns true if overflow will occur. |
|
|
149 | */ |
|
|
150 | int |
|
|
151 | buf_overflow (const char *buf1, const char *buf2, int bufsize) |
|
|
152 | { |
|
|
153 | int len1 = 0, len2 = 0; |
|
|
154 | |
|
|
155 | if (buf1) |
|
|
156 | len1 = strlen (buf1); |
|
|
157 | |
|
|
158 | if (buf2) |
|
|
159 | len2 = strlen (buf2); |
|
|
160 | |
|
|
161 | if ((len1 + len2) >= bufsize) |
|
|
162 | return 1; |
|
|
163 | |
|
|
164 | return 0; |
|
|
165 | } |
|
|