Changeset 3147 in MondoRescue for branches/3.1/mondo/src/common/libmondo-string.c
- Timestamp:
- Jun 19, 2013, 8:34:46 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mondo/src/common/libmondo-string.c
r2508 r3147 665 665 */ 666 666 void strip_spaces(char *in_out) 667 { 668 /*@ buffers ***************************************************** */ 669 char *tmp = NULL; 670 671 /*@ int ******************************************************** */ 672 int i; 673 674 /*@ end vars *************************************************** */ 675 676 assert(in_out != NULL); 677 malloc_string(tmp); 678 for (i = 0; in_out[i] <= ' ' && i < (int) strlen(in_out) -1; i++); 679 strcpy(tmp, in_out + i); 680 for (i = (int) strlen(tmp) -1; i >= 0 && tmp[i] <= ' '; i--); 681 i++; 682 tmp[i] = '\0'; 683 684 // Now tmp contains the stripped string 685 strcpy(in_out,tmp); 686 paranoid_free(tmp); 687 } 688 689 /** 690 * Remove all characters whose ASCII value is less than or equal to 32 691 * (spaces and control characters) from both sides of @p in_out. 692 * @param in_out The string to strip spaces/control characters from (modified). 693 */ 694 void strip_spaces2(char *in_out) 667 695 { 668 696 /*@ buffers ***************************************************** */ … … 752 780 * @return @p partition. 753 781 */ 754 char *truncate_to_drive_name(c har *partition)782 char *truncate_to_drive_name(const char *partition) 755 783 { 756 784 int i = strlen(partition) - 1;
Note:
See TracChangeset
for help on using the changeset viewer.