comparison arogue5/mdport.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 5b6855d5d089
children 827441d05b3e
comparison
equal deleted inserted replaced
303:e06ebc407615 304:e52a8a7ad4c5
110 # define _puts(s) tputs(s, 0, putchar); 110 # define _puts(s) tputs(s, 0, putchar);
111 # define SO enter_standout_mode 111 # define SO enter_standout_mode
112 # define SE exit_standout_mode 112 # define SE exit_standout_mode
113 #endif 113 #endif
114 114
115 #ifdef _WIN32
115 static int md_standout_mode = 0; 116 static int md_standout_mode = 0;
117 #endif
116 118
117 void 119 void
118 md_raw_standout(void) 120 md_raw_standout(void)
119 { 121 {
120 #ifdef _WIN32 122 #ifdef _WIN32
290 if(SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, szPath))) 292 if(SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, szPath)))
291 h = szPath; 293 h = szPath;
292 #endif 294 #endif
293 295
294 if ( (h == NULL) || (*h == '\0') ) 296 if ( (h == NULL) || (*h == '\0') )
297 {
295 if ( (h = getenv("HOME")) == NULL ) 298 if ( (h = getenv("HOME")) == NULL )
299 {
296 if ( (h = getenv("HOMEDRIVE")) == NULL) 300 if ( (h = getenv("HOMEDRIVE")) == NULL)
297 h = ""; 301 h = "";
298 else 302 else
299 { 303 {
300 strncpy(homedir,h,PATH_MAX-1); 304 strncpy(homedir,h,PATH_MAX-1);
301 homedir[PATH_MAX-1] = 0; 305 homedir[PATH_MAX-1] = 0;
302 306
303 if ( (h = getenv("HOMEPATH")) == NULL) 307 if ( (h = getenv("HOMEPATH")) == NULL)
304 h = ""; 308 h = "";
305 } 309 }
310 }
311 }
306 312
307 313
308 len = strlen(homedir); 314 len = strlen(homedir);
309 strncat(homedir,h,PATH_MAX-len-1); 315 strncat(homedir,h,PATH_MAX-len-1);
310 len = strlen(homedir); 316 len = strlen(homedir);
373 /* 379 /*
374 * Set back to original user, just in case 380 * Set back to original user, just in case
375 */ 381 */
376 setuid(getuid()); 382 setuid(getuid());
377 setgid(getgid()); 383 setgid(getgid());
378 execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", 0); 384 execl(sh == NULL ? "/bin/sh" : sh, "shell", "-i", (char *) NULL);
379 perror("No shelly"); 385 perror("No shelly");
380 _exit(-1); 386 _exit(-1);
381 } 387 }
382 else /* Application */ 388 else /* Application */
383 { 389 {