mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-28 22:15:49 -04:00
Merge branch 'master' of swgilluminati.com:DarthArgus/src
This commit is contained in:
@@ -59,9 +59,10 @@ void ServerConsole::run()
|
||||
char inBuf[1024] = {"\0"};
|
||||
while(! feof(stdin))
|
||||
{
|
||||
fread(inBuf, 1024, 1, stdin);
|
||||
input += inBuf;
|
||||
memset(inBuf, 0, sizeof(inBuf));
|
||||
if (fread(inBuf, 1024, 1, stdin)) {
|
||||
input += inBuf;
|
||||
memset(inBuf, 0, sizeof(inBuf));
|
||||
}
|
||||
}
|
||||
|
||||
if(input.length() > 0)
|
||||
|
||||
@@ -119,10 +119,11 @@ void Os::installCommon(void)
|
||||
char buffer[512];
|
||||
while (!feof(f))
|
||||
{
|
||||
fgets(buffer, 512, f);
|
||||
if (strncmp(buffer, "processor\t: ", 12)==0)
|
||||
{
|
||||
processorCount = atoi(buffer+12)+1;
|
||||
if (fgets(buffer, 512, f) != NULL) {
|
||||
if (strncmp(buffer, "processor\t: ", 12)==0)
|
||||
{
|
||||
processorCount = atoi(buffer+12)+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
|
||||
+19
-20
@@ -370,28 +370,27 @@ char buffer[1024];
|
||||
x = 0;
|
||||
while(!feof(fp))
|
||||
{
|
||||
fgets( buffer, 1023, fp);
|
||||
|
||||
// get rid of '\n' and '\r' for comparisons
|
||||
strtok(buffer,"\r\n");
|
||||
len = (int)strlen(buffer);
|
||||
if( len > 0 )
|
||||
{
|
||||
if( nline == 0 )
|
||||
if (fgets( buffer, 1023, fp) != NULL) {
|
||||
// get rid of '\n' and '\r' for comparisons
|
||||
strtok(buffer,"\r\n");
|
||||
len = (int)strlen(buffer);
|
||||
if( len > 0 )
|
||||
{
|
||||
passString = (char *)malloc( len + 1 );
|
||||
strcpy(passString,buffer);
|
||||
if( nline == 0 )
|
||||
{
|
||||
passString = (char *)malloc( len + 1 );
|
||||
strcpy(passString,buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
allowedAddressList[x] = (char *)malloc( len + 1 );
|
||||
strcpy(allowedAddressList[x],buffer);
|
||||
x++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
allowedAddressList[x] = (char *)malloc( len + 1 );
|
||||
strcpy(allowedAddressList[x],buffer);
|
||||
x++;
|
||||
}
|
||||
}
|
||||
nline++;
|
||||
}
|
||||
|
||||
nline++;
|
||||
}
|
||||
}
|
||||
// clean up
|
||||
fclose(fp);
|
||||
return true;
|
||||
|
||||
+17
-16
@@ -367,26 +367,27 @@ char buffer[1024];
|
||||
x = 0;
|
||||
while(!feof(fp))
|
||||
{
|
||||
fgets( buffer, 1023, fp);
|
||||
if (fgets( buffer, 1023, fp) != NULL) {
|
||||
|
||||
// get rid of '\n' and '\r' for comparisons
|
||||
strtok(buffer,"\r\n");
|
||||
len = strlen(buffer);
|
||||
if( len > 0 )
|
||||
{
|
||||
if( nline == 0 )
|
||||
// get rid of '\n' and '\r' for comparisons
|
||||
strtok(buffer,"\r\n");
|
||||
len = strlen(buffer);
|
||||
if( len > 0 )
|
||||
{
|
||||
passString = (char *)malloc( len + 1 );
|
||||
strcpy(passString,buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
allowedAddressList[x] = (char *)malloc( len + 1 );
|
||||
strcpy(allowedAddressList[x],buffer);
|
||||
x++;
|
||||
if( nline == 0 )
|
||||
{
|
||||
passString = (char *)malloc( len + 1 );
|
||||
strcpy(passString,buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
allowedAddressList[x] = (char *)malloc( len + 1 );
|
||||
strcpy(allowedAddressList[x],buffer);
|
||||
x++;
|
||||
}
|
||||
}
|
||||
nline++;
|
||||
}
|
||||
nline++;
|
||||
}
|
||||
|
||||
// clean up
|
||||
|
||||
Reference in New Issue
Block a user