misc.c

changeset 32
7e74a8d61b76
parent 9
55e7f2ff6021
child 36
63cd573ffbcf
equal deleted inserted replaced
31:e9cad8bd8ec8 32:7e74a8d61b76
158 158
159 return name; 159 return name;
160 } 160 }
161 161
162 162
163 void stripws(char *p)
164 {
165 int l;
166
167 l=strspn(p, " ");
168 if(l!=0)
169 strcpy(p, p+l);
170 l=strlen(p);
171
172 while(--l>=0){
173 if(*(p+l)!=' ')
174 break;
175 }
176 *(p+l+1)='\0';
177 }
178
179
163 /* */ 180 /* */
164 181
165 182
166 bool readf(FILE *f, void *buf, size_t n) 183 bool readf(FILE *f, void *buf, size_t n)
167 { 184 {

mercurial