Changeset 8661caa for lib/misc.c
- Timestamp:
- 2008-08-04T14:45:24Z (16 years ago)
- Branches:
- master
- Children:
- 87f525e
- Parents:
- 4ac647d (diff), 718e05f (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
-
lib/misc.c
r4ac647d r8661caa 60 60 strcpy(text, text2); 61 61 g_free(text2); 62 }63 64 char *normalize(const char *s)65 {66 static char buf[BUF_LEN];67 char *t, *u;68 int x = 0;69 70 g_return_val_if_fail((s != NULL), NULL);71 72 u = t = g_strdup(s);73 74 strcpy(t, s);75 g_strdown(t);76 77 while (*t && (x < BUF_LEN - 1)) {78 if (*t != ' ') {79 buf[x] = *t;80 x++;81 }82 t++;83 }84 buf[x] = '\0';85 g_free(u);86 return buf;87 62 } 88 63 … … 398 373 void random_bytes( unsigned char *buf, int count ) 399 374 { 375 #ifndef _WIN32 400 376 static int use_dev = -1; 401 377 … … 447 423 448 424 if( !use_dev ) 425 #endif 449 426 { 450 427 int i; … … 607 584 md5_byte_t pass_md5[16]; 608 585 md5_state_t md5_state; 609 int ret, i; 610 611 if( base64_decode( hash, &pass_dec ) != 21 ) 612 { 613 ret = -1; 614 } 615 else 586 int ret = -1, i; 587 588 if( base64_decode( hash, &pass_dec ) == 21 ) 616 589 { 617 590 md5_init( &md5_state );
Note: See TracChangeset
for help on using the changeset viewer.