summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libcurses/tinfo/lib_tgoto.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/libcurses/tinfo/lib_tgoto.c b/lib/libcurses/tinfo/lib_tgoto.c
index 536771fd17e..887cb8f5f5b 100644
--- a/lib/libcurses/tinfo/lib_tgoto.c
+++ b/lib/libcurses/tinfo/lib_tgoto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_tgoto.c,v 1.5 2010/01/12 23:22:06 nicm Exp $ */
+/* $OpenBSD: lib_tgoto.c,v 1.6 2010/01/14 22:53:22 nicm Exp $ */
/****************************************************************************
* Copyright (c) 2000-2006,2008 Free Software Foundation, Inc. *
@@ -37,7 +37,7 @@
#include <ctype.h>
#include <termcap.h>
-MODULE_ID("$Id: lib_tgoto.c,v 1.5 2010/01/12 23:22:06 nicm Exp $")
+MODULE_ID("$Id: lib_tgoto.c,v 1.6 2010/01/14 22:53:22 nicm Exp $")
#if !PURE_TERMINFO
static bool
@@ -176,11 +176,13 @@ tgoto_internal(const char *string, int x, int y)
string++;
}
if (result != 0) {
- copied = strlcpy(result + used, BC, length - used);
- if (copied < length - used)
- used += copied;
- else
- used += length - used - 1;
+ if (need_BC) {
+ copied = strlcpy(result + used, BC, length - used);
+ if (copied < length - used)
+ used += copied;
+ else
+ used += length - used - 1;
+ }
result[used] = '\0';
}
return result;