/****************************************************************************
- * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: captoinfo.c,v 1.51 2008/08/03 18:35:47 tom Exp $")
+MODULE_ID("$Id: captoinfo.c,v 1.54 2010/01/16 17:12:19 tom Exp $")
#define MAX_PUSHED 16 /* max # args we can push onto the stack */
static char *
save_string(char *d, const char *const s)
{
- size_t have = (d - my_string);
+ size_t have = (size_t) (d - my_string);
size_t need = have + strlen(s) + 2;
if (need > my_length) {
- my_string = (char *) realloc(my_string, my_length = (need + need));
+ my_string = (char *) _nc_doalloc(my_string, my_length = (need + need));
if (my_string == 0)
_nc_err_abort(MSG_NO_MEMORY);
d = my_string + have;
case '$':
case '\\':
case '%':
- c = *sp;
+ c = (unsigned char) (*sp);
len = 2;
break;
case '\0':
case '3':
len = 1;
while (isdigit(UChar(*sp))) {
- c = 8 * c + (*sp++ - '0');
+ c = (unsigned char) (8 * c + (*sp++ - '0'));
len++;
}
break;
default:
- c = *sp;
+ c = (unsigned char) (*sp);
len = 2;
break;
}
break;
case '^':
- c = (*++sp & 0x1f);
+ c = (unsigned char) (*++sp & 0x1f);
len = 2;
break;
default:
- c = *sp;
+ c = (unsigned char) (*sp);
len = 1;
}
if (isgraph(c) && c != ',' && c != '\'' && c != '\\' && c != ':') {