comparison xrogue/state.c @ 304:e52a8a7ad4c5

Fix many compiler warnings. There should only be two changes in behavior: arogue7/fight.c, arogue7/fight.c: a to-hit bonus is now correctly applied to characters who are not monks instead of monks who are not empty-handed. urogue/fight.c: fixed an interaction with the "debug" macro that could cause the wrong message to be displayed.
author John "Elwin" Edwards
date Wed, 14 Apr 2021 18:55:33 -0400
parents 17005af49963
children 32bc72dcbf4f
comparison
equal deleted inserted replaced
303:e06ebc407615 304:e52a8a7ad4c5
3257 #ifdef _WIN32 3257 #ifdef _WIN32
3258 if(SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, szPath))) 3258 if(SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, szPath)))
3259 h = szPath; 3259 h = szPath;
3260 #endif 3260 #endif
3261 3261
3262 if ( (h == NULL) || (*h == '\0') ) 3262 if ( (h == NULL) || (*h == '\0') ) {
3263 if ( (h = getenv("HOME")) == NULL ) 3263 if ( (h = getenv("HOME")) == NULL ) {
3264 if ( (h = getenv("HOMEDRIVE")) == NULL) 3264 if ( (h = getenv("HOMEDRIVE")) == NULL)
3265 h = ""; 3265 h = "";
3266 else 3266 else
3267 { 3267 {
3268 strncpy(homedir,h,PATH_MAX-1); 3268 strncpy(homedir,h,PATH_MAX-1);
3269 homedir[PATH_MAX-1] = 0; 3269 homedir[PATH_MAX-1] = 0;
3270 3270
3271 if ( (h = getenv("HOMEPATH")) == NULL) 3271 if ( (h = getenv("HOMEPATH")) == NULL)
3272 h = ""; 3272 h = "";
3273 } 3273 }
3274 }
3275 }
3274 3276
3275 3277
3276 len = strlen(homedir); 3278 len = strlen(homedir);
3277 strncat(homedir,h,PATH_MAX-len-1); 3279 strncat(homedir,h,PATH_MAX-len-1);
3278 len = strlen(homedir); 3280 len = strlen(homedir);
3407 /* 3409 /*
3408 * Set back to original user, just in case 3410 * Set back to original user, just in case
3409 */ 3411 */
3410 setuid(getuid()); 3412 setuid(getuid());
3411 setgid(getgid()); 3413 setgid(getgid());
3412 execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", 0); 3414 execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", (char *) NULL);
3413 perror("No shelly"); 3415 perror("No shelly");
3414 _exit(-1); 3416 _exit(-1);
3415 } 3417 }
3416 else /* Application */ 3418 else /* Application */
3417 { 3419 {