patch-fceux-server_server_cpp 701 B

1234567891011121314151617181920212223
  1. $OpenBSD: patch-fceux-server_server_cpp,v 1.2 2017/04/18 22:00:34 espie Exp $
  2. --- fceux-server/server.cpp.orig Tue Apr 18 21:10:50 2017
  3. +++ fceux-server/server.cpp Tue Apr 18 23:55:53 2017
  4. @@ -51,7 +51,9 @@
  5. // MSG_NOSIGNAL and SOL_TCP have been depreciated on osx
  6. #if defined (__APPLE__) || defined(BSD)
  7. +#if !defined(__OpenBSD__)
  8. #define MSG_NOSIGNAL SO_NOSIGPIPE
  9. +#endif
  10. #define SOL_TCP IPPROTO_TCP
  11. #endif
  12. @@ -114,7 +116,7 @@ int LoadConfigFile(char *fn)
  13. if(fp=fopen(fn,"rb"))
  14. {
  15. char buf[256];
  16. - while(fgets(buf, 256, fp) > 0)
  17. + while(fgets(buf, 256, fp) != NULL)
  18. {
  19. if(!strncasecmp(buf,"maxclients",strlen("maxclients")))
  20. sscanf(buf,"%*s %d",&ServerConfig.MaxClients);