return "";
}
// firstly clean up the line by stripping spaces from the start and end and converting tabs to spaces
- for (int d = 0; d < strlen(buffer); d++)
+ for (unsigned int d = 0; d < strlen(buffer); d++)
if ((buffer[d]) == 9)
buffer[d] = ' ';
while ((buffer[0] == ' ') && (strlen(buffer)>0)) buffer++;
while ((buffer[strlen(buffer)-1] == ' ') && (strlen(buffer)>0)) buffer[strlen(buffer)-1] = '\0';
- // empty lines are syntactically valid
- if (!strcmp(buffer,""))
- return "";
- else if (buffer[0] == '#')
+
+ // empty lines are syntactically valid, as are comments
+ if (!(*buffer) || buffer[0] == '#')
return "";
- for (int c = 0; c < strlen(buffer); c++)
+
+ for (unsigned int c = 0; c < strlen(buffer); c++)
{
// convert all spaces that are OUTSIDE quotes into hardspace (0xA0) as this will make them easier to
// search and replace later :)
}
// turn our hardspace back into softspace
- for (int d = 0; d < parsedata.length(); d++)
+ for (unsigned int d = 0; d < parsedata.length(); d++)
{
if (parsedata[d] == '\xA0')
parsedata[d] = ' ';
}
// Fix the chmod of the file to restrict it to the current user and group
chmod(filename,0600);
- for (int t = 0; t < include_stack.size(); t++)
+ for (unsigned int t = 0; t < include_stack.size(); t++)
{
if (std::string(filename) == include_stack[t])
{
char confpath[10240],newconf[10240];
// include file directive
buf += 15; // advance to filename
- for (int j = 0; j < strlen(buf); j++)
+ for (unsigned int j = 0; j < strlen(buf); j++)
{
if (buf[j] == '\\')
buf[j] = '/';
{
int ptr = 0;
char buffer[65535], c_tag[MAXBUF], c, lastc;
- int in_token, in_quotes, tptr, j, idx = 0;
+ int in_token, in_quotes, tptr, idx = 0;
char* key;
const char* buf = config->str().c_str();
key++;
}
key++;
- for (j = 0; j < strlen(key); j++)
+ for (unsigned j = 0; j < strlen(key); j++)
{
if (key[j] == '"')
{
return (sockfd);
}
}
-