- Timestamp:
- Feb 19, 2008, 1:23:14 AM (16 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 07bfbc2
- Parents:
- 5f3168a (diff), 2f69081 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
r9c7a701 r5f3168a 353 353 return(owl_strdup("")); 354 354 } 355 356 char *owl_zephyr_get_field_as_utf8(ZNotice_t *n, int j) 357 { 358 int i, count, save; 359 360 /* If there's no message here, just run along now */ 361 if (n->z_message_len == 0) 362 return(owl_strdup("")); 363 364 count=save=0; 365 for (i = 0; i < n->z_message_len; i++) { 366 if (n->z_message[i]=='\0') { 367 count++; 368 if (count == j) { 369 /* just found the end of the field we're looking for */ 370 return(owl_validate_or_convert(n->z_message + save)); 371 } else { 372 save = i + 1; 373 } 374 } 375 } 376 /* catch the last field, which might not be null terminated */ 377 if (count == j - 1) { 378 char *tmp, *out; 379 tmp = owl_malloc(n->z_message_len-save+5); 380 memcpy(tmp, n->z_message+save, n->z_message_len-save); 381 tmp[n->z_message_len-save]='\0'; 382 out = owl_validate_or_convert(tmp); 383 owl_free(tmp); 384 return out; 385 } 386 387 return(owl_strdup("")); 388 } 355 389 #else 356 390 char *owl_zephyr_get_field(void *n, int j) 357 391 { 358 392 return(owl_strdup("")); 393 } 394 char *owl_zephyr_get_field_as_utf8(ZNotice_t *n, int j) 395 { 396 return owl_zephyr_get_field(n, j); 359 397 } 360 398 #endif
Note: See TracChangeset
for help on using the changeset viewer.