/****************************************************************************
- * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2018,2019 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: lib_tparm.c,v 1.105 2018/04/07 21:12:12 tom Exp $")
+MODULE_ID("$Id: lib_tparm.c,v 1.107 2019/01/19 15:46:25 tom Exp $")
/*
* char *
if (cp == 0)
return 0;
- if ((len2 = strlen(cp)) > TPS(fmt_size)) {
- TPS(fmt_size) = len2 + TPS(fmt_size) + 2;
+ if ((len2 = strlen(cp)) + 2 > TPS(fmt_size)) {
+ TPS(fmt_size) += len2 + 2;
TPS(fmt_buff) = typeRealloc(char, TPS(fmt_size), TPS(fmt_buff));
if (TPS(fmt_buff) == 0)
return 0;
bool termcap_hack;
bool incremented_two;
- if (cp == NULL)
+ if (cp == NULL) {
+ TR(TRACE_CALLS, ("%s: format is null", TPS(tname)));
return NULL;
+ }
TPS(out_used) = 0;
len2 = strlen(cp);
* variable-length argument list.
*/
number = _nc_tparm_analyze(cp, p_is_s, &popcount);
- if (TPS(fmt_buff) == 0)
+ if (TPS(fmt_buff) == 0) {
+ TR(TRACE_CALLS, ("%s: error in analysis", TPS(tname)));
return NULL;
+ }
incremented_two = FALSE;
#endif
NCURSES_EXPORT(char *)
-tparm_varargs(const char *string,...)
+tparm_varargs(const char *string, ...)
{
va_list ap;
char *result;
#endif /* NCURSES_TPARM_VARARGS */
NCURSES_EXPORT(char *)
-tiparm(const char *string,...)
+tiparm(const char *string, ...)
{
va_list ap;
char *result;