/*
* Author: Thomas E. Dickey
*
- * $Id: cardfile.c,v 1.39 2012/06/09 20:30:32 tom Exp $
+ * $Id: cardfile.c,v 1.41 2012/11/03 19:26:50 tom Exp $
*
* File format: text beginning in column 1 is a title; other text is content.
*/
static bool try_color = FALSE;
static char default_name[] = "cardfile.dat";
-#if !HAVE_STRDUP
-#define strdup my_strdup
-static char *
-strdup(const char *s)
+static void
+failed(const char *s)
{
- char *p = typeMalloc(char, strlen(s) + 1);
- if (p)
- strcpy(p, s);
- return (p);
+ perror(s);
+ endwin();
+ ExitProgram(EXIT_FAILURE);
}
-#endif /* not HAVE_STRDUP */
static const char *
skip(const char *buffer)
}
if (card->content)
strcpy(card->content + offset, content);
+ else
+ failed("add_content");
}
}