ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/misc.C
(Generate patch)

Comparing rxvt-unicode/src/misc.C (file contents):
Revision 1.48 by ayin, Tue Oct 23 21:54:42 2007 UTC vs.
Revision 1.50 by ayin, Tue Dec 18 01:36:24 2007 UTC

116 if (len == 0) 116 if (len == 0)
117 break; 117 break;
118 else if (s[0] < 0x80) 118 else if (s[0] < 0x80)
119 *p++ = *s++; 119 *p++ = *s++;
120 else if (len >= 2 120 else if (len >= 2
121 && s[0] >= 0xc2 && s[0] <= 0xdf 121 && s[0] >= 0xc2 && s[0] <= 0xdf
122 && (s[1] & 0xc0) == 0x80) 122 && (s[1] & 0xc0) == 0x80)
123 { 123 {
124 *p++ = ((s[0] & 0x1f) << 6) 124 *p++ = ((s[0] & 0x1f) << 6)
125 | (s[1] & 0x3f); 125 | (s[1] & 0x3f);
126 s += 2; 126 s += 2;
144 || (s[0] == 0xf4 && s[1] >= 0x80 && s[1] <= 0x8f) 144 || (s[0] == 0xf4 && s[1] >= 0x80 && s[1] <= 0x8f)
145 ) 145 )
146 && (s[2] & 0xc0) == 0x80 146 && (s[2] & 0xc0) == 0x80
147 && (s[3] & 0xc0) == 0x80) 147 && (s[3] & 0xc0) == 0x80)
148 { 148 {
149 *p++ = ((s[0] & 0x07) << 18) 149 *p++ = ((s[0] & 0x07) << 18)
150 | ((s[1] & 0x3f) << 12) 150 | ((s[1] & 0x3f) << 12)
151 | ((s[2] & 0x3f) << 6) 151 | ((s[2] & 0x3f) << 6)
152 | (s[3] & 0x3f); 152 | (s[3] & 0x3f);
153 s += 4; 153 s += 4;
154 } 154 }
155 else 155 else
156 { 156 {
303 free (cs[i]); 303 free (cs[i]);
304 304
305 free (cs); 305 free (cs);
306} 306}
307 307
308void *
309rxvt_malloc (size_t size)
310{
311 void *p = malloc (size);
308 312
313 if (!p)
314 rxvt_fatal ("memory allocation failure. aborting.\n");
309 315
316 return p;
317}
318
319void *
320rxvt_calloc (size_t number, size_t size)
321{
322 void *p = calloc (number, size);
323
324 if (!p)
325 rxvt_fatal ("memory allocation failure. aborting.\n");
326
327 return p;
328}
329
330void *
331rxvt_realloc (void *ptr, size_t size)
332{
333 void *p = realloc (ptr, size);
334
335 if (!p)
336 rxvt_fatal ("memory allocation failure. aborting.\n");
337
338 return p;
339}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines