summaryrefslogtreecommitdiff
path: root/games/nethack-qt/patches/patch-aj
blob: cc9584f7f5c625def33f32ded90391565d223b96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$NetBSD: patch-aj,v 1.1 2003/02/19 20:25:21 pooka Exp $

*** src/topten.c.orig	Mon Feb  4 08:06:07 2002
--- src/topten.c	Mon Feb 10 10:48:55 2003
***************
*** 856,861 ****
--- 856,867 ----
  	    else {
  		if (playerct > 1) Strcat(pbuf, "any of ");
  		for (i = 0; i < playerct; i++) {
+ 		    /* stop printing players if there are too many to fit */
+ 		    if (strlen(pbuf) + strlen(players[i]) + 2 >= BUFSZ) {
+ 			if (strlen(pbuf) < BUFSZ-4) Strcat(pbuf, "...");
+ 			else Strcpy(pbuf+strlen(pbuf)-4, "...");
+ 			break;
+ 		    }
  		    Strcat(pbuf, players[i]);
  		    if (i < playerct-1) {
  			if (players[i][0] == '-' &&