- Timestamp:
- Sep 20, 2016, 7:59:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_error.c
r488 r510 244 244 { 245 245 char * p; 246 char * q; 246 247 int num = 0; 247 248 unsigned int i; … … 289 290 if (p == NULL) 290 291 break; 292 293 q = p; while (*q != '\0') { *q = toupper( (int) *q); ++q; } 291 294 292 295 for (i = 0; i < SH_CLA_MAX; ++i) … … 495 498 int i; 496 499 int level = (-1); 500 char * tmp; 501 char * q; 497 502 498 503 SL_ENTER(_("sh_error_convert_level")); … … 501 506 SL_RETURN( -1, _("sh_error_convert_level")); 502 507 508 q = sh_util_strdup(str_s); 509 tmp = q; while (*tmp != '\0') { *tmp = tolower( (int) *tmp); ++tmp; } 510 503 511 for (i = 0; i < SH_EEF_MAX; ++i) 504 512 { 505 if (0 == sl_strncmp( str_s, _(eef_tab[i].str),513 if (0 == sl_strncmp(q, _(eef_tab[i].str), 506 514 sl_strlen(eef_tab[i].str))) 507 515 { … … 511 519 } 512 520 521 SH_FREE(q); 513 522 SL_RETURN( level, _("sh_error_convert_level")); 514 523 } … … 554 563 555 564 int old_facility; 556 const char * str_s = str_in; 565 char * str_s; 566 char * str_orig; 567 char * tmp; 557 568 558 569 SL_ENTER(_("sh_error_set_level")); 559 570 571 str_s = sh_util_strdup(str_in); 572 str_orig = str_s; 573 574 tmp = str_s; while (*tmp != '\0') { *tmp = tolower( (int) *tmp); ++tmp; } 575 560 576 if (IsInitialized == BAD) 561 577 (void) sh_error_init(); … … 650 666 if (!str_s) 651 667 { 668 if (str_orig) SH_FREE(str_orig); 652 669 SL_RETURN ((-1), _("sh_error_set_level")); 653 670 } … … 675 692 sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS, 676 693 _("priority"), str_in); 694 SH_FREE(str_orig); 677 695 SL_RETURN (-1, _("sh_error_set_level")); 678 696 } 679 697 compute_flag_err_debug(); 680 698 compute_flag_err_info(); 699 SH_FREE(str_orig); 681 700 SL_RETURN (0, _("sh_error_set_level")); 682 701 }
Note:
See TracChangeset
for help on using the changeset viewer.