Changes in zephyr.c [9c7a701:5577606]
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
r9c7a701 r5577606 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(void *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.