diff --git a/src/comm.c b/src/comm.c index 45941b0..fa1f3c3 100644 --- a/src/comm.c +++ b/src/comm.c @@ -669,8 +669,15 @@ static int get_max_players(void) /* set the current to the maximum */ limit.rlim_cur = limit.rlim_max; if (setrlimit(RLIMIT_NOFILE, &limit) < 0) { - perror("SYSERR: calling setrlimit"); - exit(1); +#if defined(__APPLE__) && defined(RLIMIT_NOFILE) && defined(OPEN_MAX) + /* On OS X, setting rlim_cur above OPEN_MAX fails, so try again + * with OPEN_MAX. */ + limit.rlim_cur = OPEN_MAX; +#endif + if (setrlimit(RLIMIT_NOFILE, &limit) < 0) { + perror("SYSERR: calling setrlimit"); + exit(1); + } } #ifdef RLIM_INFINITY if (limit.rlim_max == RLIM_INFINITY) diff --git a/src/hedit.c b/src/hedit.c index 55e0479..694d69f 100644 --- a/src/hedit.c +++ b/src/hedit.c @@ -207,7 +207,7 @@ static void hedit_disp_menu(struct descriptor_data *d) void hedit_parse(struct descriptor_data *d, char *arg) { char buf[MAX_STRING_LENGTH]; - char *oldtext = '\0'; + char *oldtext = ""; int number; switch (OLC_MODE(d)) { diff --git a/src/magic.c b/src/magic.c index daa1650..bcfefec 100644 --- a/src/magic.c +++ b/src/magic.c @@ -971,7 +971,7 @@ void mag_rooms(int level, struct char_data *ch, int spellnum) room_rnum rnum; int duration; bool failure = FALSE; - event_id IdNum = -1; + event_id IdNum = eNULL; const char *msg = NULL; const char *room = NULL; @@ -995,7 +995,7 @@ void mag_rooms(int level, struct char_data *ch, int spellnum) } - if (failure || (event_id)IdNum == -1) { + if (failure || IdNum == eNULL) { send_to_char(ch, "You failed!\r\n"); return; } diff --git a/src/modify.c b/src/modify.c index 96898c7..4e96b48 100644 --- a/src/modify.c +++ b/src/modify.c @@ -474,7 +474,7 @@ void page_string(struct descriptor_data *d, char *str, int keep_internal) if (!str || !*str) return; - if ((GET_PAGE_LENGTH(d->character) < 5 || GET_PAGE_LENGTH(d->character) > 255)) + if (GET_PAGE_LENGTH(d->character) < 5) GET_PAGE_LENGTH(d->character) = PAGE_LENGTH; d->showstr_count = count_pages(str, d->character); CREATE(d->showstr_vector, char *, d->showstr_count); diff --git a/src/objsave.c b/src/objsave.c index 8b48560..db700ec 100644 --- a/src/objsave.c +++ b/src/objsave.c @@ -1184,7 +1184,8 @@ static int Crash_load_objs(struct char_data *ch) { int i, num_of_days, orig_rent_code, num_objs=0; unsigned long cost; struct obj_data *cont_row[MAX_BAG_ROWS]; - int rentcode,timed,netcost,gold,account,nitems; + int rentcode = RENT_UNDEF; + int timed,netcost,gold,account,nitems; obj_save_data *loaded, *current; if (!get_filename(filename, sizeof(filename), CRASH_FILE, GET_NAME(ch))) diff --git a/src/protocol.c b/src/protocol.c index 21a98b4..05f3345 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -12,7 +12,6 @@ #endif #include #include "protocol.h" -#include /****************************************************************************** The following section is for Diku/Merc derivatives. Replace as needed.