]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/lib_tgoto.c
ncurses 5.7 - patch 20100501
[ncurses.git] / ncurses / tinfo / lib_tgoto.c
index 77fc6ceabd4a8caad6f7623c67f4ad8bfd5afffe..e07f4643138bd2f129e3aa0568f1431df734146e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2000-2001,2002 Free Software Foundation, Inc.              *
+ * Copyright (c) 2000-2006,2008 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -35,7 +35,7 @@
 #include <ctype.h>
 #include <termcap.h>
 
-MODULE_ID("$Id: lib_tgoto.c,v 1.10 2002/08/31 22:14:47 Philippe.Blain Exp $")
+MODULE_ID("$Id: lib_tgoto.c,v 1.13 2008/08/16 19:29:32 tom Exp $")
 
 #if !PURE_TERMINFO
 static bool
@@ -128,7 +128,7 @@ tgoto_internal(const char *string, int x, int y)
                        *value = 0200;  /* tputs will treat this as \0 */
                    }
                }
-               result[used++] = *value++;
+               result[used++] = (char) *value++;
                break;
            case '%':
                result[used++] = *string;
@@ -155,7 +155,7 @@ tgoto_internal(const char *string, int x, int y)
                *value = 16 * (*value / 10) + (*value % 10);
                break;
            case 'D':           /* Reverse coding (Delta Data) */
-               *value -= 2 * (*value / 16);
+               *value -= 2 * (*value % 16);
                break;
            }
            if (fmt != 0) {
@@ -198,6 +198,6 @@ tgoto(const char *string, int x, int y)
        result = tgoto_internal(string, x, y);
     else
 #endif
-       result = tparm((NCURSES_CONST char *) string, y, x);
+       result = TPARM_2((NCURSES_CONST char *) string, y, x);
     returnPtr(result);
 }