#include <stdio.h> /* *printf(), fgets() */
#include <stdlib.h> /* free(), strtol() */
#include <string.h> /* strlen(), memcpy(), strchr(), strspn() */
#include <stdio.h> /* *printf(), fgets() */
#include <stdlib.h> /* free(), strtol() */
#include <string.h> /* strlen(), memcpy(), strchr(), strspn() */
*general_names[] = { "name", "vhost", "description", "", "#numeric", 0 },
*motd_names[] = { "host", "file", 0 },
*class_names[] = { "name", "#pingfreq", "#connectfreq", "#maxlinks", "#sendq", 0 },
*general_names[] = { "name", "vhost", "description", "", "#numeric", 0 },
*motd_names[] = { "host", "file", 0 },
*class_names[] = { "name", "#pingfreq", "#connectfreq", "#maxlinks", "#sendq", 0 },
- *removed_features[] = { "VIRTUAL_HOST", "OPERS_SEE_IN_SECRET_CHANNELS", "LOCOP_SEE_IN_SECRET_CHANNELS", 0 };
+ *removed_features[] = { "VIRTUAL_HOST", "TIMESEC", "OPERS_SEE_IN_SECRET_CHANNELS", "LOCOP_SEE_IN_SECRET_CHANNELS", "HIS_STATS_h", "HIS_DESYNCS", "AUTOHIDE", 0 };
char orig_line[512], line[512], dbuf[512];
char *fields[MAX_FIELDS + 1];
unsigned int nfields;
char orig_line[512], line[512], dbuf[512];
char *fields[MAX_FIELDS + 1];
unsigned int nfields;
-#define dupstring(TARGET, SOURCE) do { free(TARGET); if (SOURCE) { size_t len = strlen(SOURCE); (TARGET) = malloc(len+1); memcpy((TARGET), (SOURCE), len); } else (TARGET) = 0; } while(0)
+#define dupstring(TARGET, SOURCE) do { free(TARGET); if (SOURCE) { size_t len = strlen(SOURCE) + 1; (TARGET) = malloc(len); memcpy((TARGET), (SOURCE), len); } else (TARGET) = 0; } while(0)
{
conn = calloc(1, sizeof(*conn) + nlen);
for (ii = 0; ii < nlen; ++ii)
{
conn = calloc(1, sizeof(*conn) + nlen);
for (ii = 0; ii < nlen; ++ii)
{
for (sl = conn->origins; sl; sl = sl->next)
fprintf(stdout, "# %s\n", sl->value);
{
for (sl = conn->origins; sl; sl = sl->next)
fprintf(stdout, "# %s\n", sl->value);
/* Wasn't remapped, wasn't removed: print it out. */
fprintf(stdout, "\t\"%s\" =", feat->name);
for (sl = feat->values; sl; sl = sl->next)
/* Wasn't remapped, wasn't removed: print it out. */
fprintf(stdout, "\t\"%s\" =", feat->name);
for (sl = feat->values; sl; sl = sl->next)
- /* Strip EOL character(s) and pass blank lines through. */
- while (len > 0 && (line[len-1] == '\n' || line[len-1] == '\r'))
+ /* Strip trailing whitespace. */
+ while (len > 0 && isspace(line[len-1]))