Changeset 00fd005
- Timestamp:
- 2011-01-29T20:50:05Z (14 years ago)
- Branches:
- master
- Children:
- 060d066
- Parents:
- 02e06b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r02e06b5 r00fd005 804 804 const char *t; 805 805 int i; 806 char changes[512], *p,st2 = 2;806 char changes[512], st2 = 2; 807 807 char badflag = 0; 808 808 809 809 memset( m, 0, sizeof( m ) ); 810 810 811 /* Keep track of which modes are enabled in this array. */ 811 812 for( t = irc->umode; *t; t ++ ) 812 813 if( *t < sizeof( m ) ) 813 814 m[(int)*t] = 1; 814 815 815 p = changes;816 for( t = s; *t ; t ++ )816 i = 0; 817 for( t = s; *t && i < sizeof( changes ) - 3; t ++ ) 817 818 { 818 819 if( *t == '+' || *t == '-' ) … … 824 825 if( m[(int)*t] != st) 825 826 { 827 /* If we're actually making a change, remember this 828 for the response. */ 826 829 if( st != st2 ) 827 st2 = st, *p++= st ? '+' : '-';828 *p++= *t;830 st2 = st, changes[i++] = st ? '+' : '-'; 831 changes[i++] = *t; 829 832 } 830 833 m[(int)*t] = st; … … 833 836 badflag = 1; 834 837 } 835 *p = '\0'; 836 838 changes[i] = '\0'; 839 840 /* Convert the m array back into an umode string. */ 837 841 memset( irc->umode, 0, sizeof( irc->umode ) ); 838 839 842 for( i = 'A'; i <= 'z' && strlen( irc->umode ) < ( sizeof( irc->umode ) - 1 ); i ++ ) 840 843 if( m[i] )
Note: See TracChangeset
for help on using the changeset viewer.