/*
+#include <string.h>
* Copyright (C) 2012 Andy Spencer <andy753421@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <ncurses.h>
#include "screen.h"
debug_fd = fopen("/tmp/lackey.log", "w+");
}
+/* Misc functions */
+char *sdup(const char *str)
+{
+ if (str == NULL)
+ return NULL;
+ int len = strlen(str);
+ char *dup = malloc(len+1);
+ memcpy(dup, str, len+1);
+ return dup;
+}
+
/* Debugging functions */
int debug(char *fmt, ...)
{