Don't modify const memory in-place. Bump revision.

This commit is contained in:
joerg 2020-04-18 22:03:58 +00:00
parent a817a3f602
commit aae92f8809
3 changed files with 35 additions and 4 deletions

View file

@ -1,9 +1,8 @@
# $NetBSD: Makefile,v 1.55 2020/03/10 22:09:51 wiz Exp $
# $NetBSD: Makefile,v 1.56 2020/04/18 22:03:58 joerg Exp $
#
DISTNAME= eboard-1.1.1
#PKGREVISION= 1
PKGREVISION= 2
PKGREVISION= 3
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=eboard/}
EXTRACT_SUFX= .tar.bz2

View file

@ -1,8 +1,9 @@
$NetBSD: distinfo,v 1.9 2020/01/14 08:48:44 hauke Exp $
$NetBSD: distinfo,v 1.10 2020/04/18 22:03:58 joerg Exp $
SHA1 (eboard-1.1.1.tar.bz2) = 029cf1e7503fc2a862b9880da9ea6ab91e5614cd
RMD160 (eboard-1.1.1.tar.bz2) = 13bdfe6d33a143d619c6c5be8d849ced9b95e2c4
SHA512 (eboard-1.1.1.tar.bz2) = 0e124abc786996070464c3d9ef5eafa107b990df7593d774bf302e01e0d07427f2a67bc33ab61a188d2902aa35abb8cec6356e4e088f4a6b40e189556b588704
Size (eboard-1.1.1.tar.bz2) = 462386 bytes
SHA1 (patch-cimg.cc) = 23c019b869c95d4336dda5272eb6c50177686b71
SHA1 (patch-ntext.cc) = be60a9d35fe63ae8308e4a64854c2bb5e7973541
SHA1 (patch-proto__xboard.cc) = 5792bee2f90f0576e8a401e6d405b5cfb8b3744e

View file

@ -0,0 +1,31 @@
$NetBSD: patch-ntext.cc,v 1.1 2020/04/18 22:03:58 joerg Exp $
Don't modify const memory in place.
--- ntext.cc.orig 2020-04-17 11:40:43.382486571 +0000
+++ ntext.cc
@@ -237,7 +237,7 @@ void NText::setBG(int c) {
void NText::append(const char *text, int len, int color) {
int i;
NLine *nl;
- char *p;
+ const char *p;
if (len < 0) {
discardExcess();
@@ -246,13 +246,10 @@ void NText::append(const char *text, int
p = strchr(text, '\n');
if (p!=NULL) {
- *p = 0;
- i = strlen(text);
- nl = new NLine(text, color);
- *p = '\n';
+ nl = new NLine(text, color, p-text);
lines.push_back(nl);
formatLine(lines.size()-1);
- append(&p[1], len-(i+1), color);
+ append(&p[1], len-(p-text+1), color);
return;
}