Skip to content

Commit

Permalink
Fix format strings. Fix ordering of pointers relative to 0. Bump
Browse files Browse the repository at this point in the history
revision.
  • Loading branch information
jsonn committed Feb 8, 2017
1 parent b86ccea commit fc83408
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 6 deletions.
4 changes: 2 additions & 2 deletions games/kajaani-kombat/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.25 2015/04/25 14:22:57 tnn Exp $
# $NetBSD: Makefile,v 1.26 2017/02/08 00:04:53 joerg Exp $
#

DISTNAME= kajaani-kombat-0.7
PKGREVISION= 10
PKGREVISION= 11
CATEGORIES= games
MASTER_SITES= http://kombat.kajaani.net/dl/

Expand Down
6 changes: 4 additions & 2 deletions games/kajaani-kombat/distinfo
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
$NetBSD: distinfo,v 1.5 2015/11/03 20:56:53 agc Exp $
$NetBSD: distinfo,v 1.6 2017/02/08 00:04:53 joerg Exp $

SHA1 (kajaani-kombat-0.7.tar.gz) = a6aa674591fef6445c1dbdba446773e9e3d91c8c
RMD160 (kajaani-kombat-0.7.tar.gz) = 0f932876dfe5f9f32d9889f0b1720dd9b570b8e2
SHA512 (kajaani-kombat-0.7.tar.gz) = 84f6923b73c9529fa600c533b5a3de9ea9411f81060c5ad9fb85346fa17c9cb70bf6ba8222319e123372b01286a11b40bb355e8ef8c9bec95cd98f4d0e0460cb
Size (kajaani-kombat-0.7.tar.gz) = 1805504 bytes
SHA1 (patch-aa) = bc1ec637e480db4ec499b51d9bd9fabd951b1048
SHA1 (patch-client__net.cpp) = 547692aff95f540c91ca5ab9602c03f05ceb7557
SHA1 (patch-client__net.cpp) = d0dfcaf5a7cf6063cb5fb2c23830be9372ae6414
SHA1 (patch-config.cpp) = d330cbb6a63e814c09fcef5ee88b19a78e9ce7f2
SHA1 (patch-game__server.cpp) = 8da51acf0732363212f27a12037d53438371e05f
39 changes: 37 additions & 2 deletions games/kajaani-kombat/patches/patch-client__net.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
$NetBSD: patch-client__net.cpp,v 1.1 2012/11/16 00:50:13 joerg Exp $
$NetBSD: patch-client__net.cpp,v 1.2 2017/02/08 00:04:53 joerg Exp $

--- client_net.cpp.orig 2012-11-15 15:37:19.000000000 +0000
Pointers are not relative to 0.
Don't shadow local variable.
--- client_net.cpp.orig 2005-01-22 16:51:34.000000000 +0000
+++ client_net.cpp
@@ -31,13 +31,13 @@ client_tcpnet::client_tcpnet(IPaddress *
assert (ret != -1);
cond = SDL_CreateCond();
- if (cond <0)
+ if (!cond)
{
fprintf (stderr, "Error creating cond variable\n");
exit(2);
}
mutex = SDL_CreateMutex();
- if (mutex < 0)
+ if (!mutex)
{
fprintf (stderr, "Error creating mutex\n");
exit(2);
@@ -45,13 +45,13 @@ client_tcpnet::client_tcpnet(IPaddress *
active = true;
trans_th = SDL_CreateThread (&client_tcpnet::transf_func, (void *) this);
- if (trans_th < 0)
+ if (!trans_th)
{
fprintf(stderr, "Error starting thread: %s\n", SDL_GetError());
exit(2);
}
input_th = SDL_CreateThread (&client_tcpnet::input_func, (void *) this);
- if (input_th < 0)
+ if (!input_th)
{
fprintf(stderr, "Error starting thread: %s\n", SDL_GetError());
exit(2);
@@ -192,7 +192,7 @@ int client_tcpnet::input_func(void *data
if (SDLNet_SocketReady(cl->socket) == 0) continue;
msg *m = 0;
Expand Down
15 changes: 15 additions & 0 deletions games/kajaani-kombat/patches/patch-config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$NetBSD: patch-config.cpp,v 1.1 2017/02/08 00:04:53 joerg Exp $

Fix format string to match argument.

--- config.cpp.orig 2017-01-08 19:37:40.160134851 +0000
+++ config.cpp
@@ -228,7 +228,7 @@ void file_config::read_config( string& f
port = ( strlen( v ) ? v : DEFAULT_PORT );
}
else {
- fprintf( stderr," Unknown key/value pair (%s/%s) on line %u\n", key.c_str(), v, linenum );
+ fprintf( stderr," Unknown key/value pair (%s/%s) on line %zu\n", key.c_str(), v, linenum );
}
}
/*
15 changes: 15 additions & 0 deletions games/kajaani-kombat/patches/patch-game__server.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$NetBSD: patch-game__server.cpp,v 1.1 2017/02/08 00:04:53 joerg Exp $

Pointers are not relative to 0.

--- game_server.cpp.orig 2017-01-08 19:35:01.809714788 +0000
+++ game_server.cpp
@@ -64,7 +64,7 @@ void game_server::init_net()

// OK, init server thread to listen to clients
con_th = SDL_CreateThread (&game_server::connection_accepter, (void *) this);
- if (con_th < 0)
+ if (!con_th)
{
fprintf (stderr, "[SRV] Error starting thread: %s\n", SDL_GetError());
exit(2);

0 comments on commit fc83408

Please sign in to comment.