Fix an off-by-one on the pawn 2D array indexes.
[Project_algorithmic_C.git] / lib / debug.c
diff --git a/lib/debug.c b/lib/debug.c
new file mode 100644 (file)
index 0000000..e322990
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * =====================================================================================
+ *
+ *       Filename:  debug.c
+ *
+ *    Description:  Debugging functions
+ *
+ *        Version:  1.0
+ *        Created:  27/04/2017 12:58:37
+ *       Revision:  none
+ *       Compiler:  gcc
+ *
+ *         Author:  Jerome Benoit (fraggle), jerome.benoit@piment-noir.org
+ *   Organization:  Piment Noir
+ *
+ * =====================================================================================
+ */
+
+#include <string.h>
+
+#include "debug.h"
+
+void dbg_mvprintw(int base_y, int base_x, const char* fmt, va_list varglist) {
+
+    mvprintw(base_y, base_x - strlen(fmt)/2, fmt, varglist);
+}