Changeset 3278 in genesis for tools/nodechk/nodechk.c
- Timestamp:
- Nov 22, 2004, 11:06:55 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/nodechk/nodechk.c
r3271 r3278 6 6 // Nodechck - Programma om wleiden.conf files te lezen 7 7 // en te vergelijken met actuele informatie uit de nodes 8 // 9 // Rev.0.4 22/11/2004 RO 10 // compatibility: 11 // io.h verwijderd 12 // memicmp() voor unix toegevoegd 13 // getest op unix 8 14 // 9 15 // Rev.0.3 22/11/2004 RO … … 32 38 33 39 #include <stdio.h> 34 #include <io.h>35 40 #include <time.h> 36 41 #include <string.h> … … 179 184 BOOL bCardBezig; 180 185 186 #ifndef WIN32 187 int memicmp(char *a,char *b,size_t c); 188 int memicmp(char *a,char *b,size_t c) 189 { 190 int i; 191 char ba[200],bb[200]; 192 memcpy(ba,a,c); 193 memcpy(bb,b,c); 194 for (i=0;i<c;i++) 195 { 196 ba[i]=toupper(ba[i]); 197 bb[i]=toupper(bb[i]); 198 } 199 return memcmp(ba,bb,c); 200 } 201 202 #endif 203 181 204 main() 182 205 { … … 189 212 fread(location,sizeof(char),64,hFile); 190 213 fclose(hFile); 214 { 215 char *pos=&location[strlen(location)-1]; 216 while (*pos=='\n'||*pos=='\r'||*pos=='\t'||*pos==' ') 217 { 218 *pos='\0'; 219 pos--; 220 } 221 } 191 222 if (hFile=fopen("nnames","r")) 192 223 { … … 548 579 else strncpy(pCd->ip,pos+3,sizeof(pCd->ip)); 549 580 } 550 else if (!mem icmp(pos,"DESC=",5)) strncpy(pCd->desc,pos+5,sizeof(pCd->desc));581 else if (!memcmp(pos,"DESC=",5)) strncpy(pCd->desc,pos+5,sizeof(pCd->desc)); 551 582 else if (!memicmp(pos,"SDESC=",6)) strncpy(pCd->sdesc,pos+6,sizeof(pCd->sdesc)); 552 583 else if (!memicmp(pos,"SPEED=",6)) strncpy(pCd->speed,pos+6,sizeof(pCd->speed));
Note:
See TracChangeset
for help on using the changeset viewer.