diff --git a/MD_Getc.c b/MD_Getc.c index ee58373..01a9834 100644 --- a/MD_Getc.c +++ b/MD_Getc.c @@ -60,6 +60,8 @@ int md_getstring(char *ptr, int maxlen, char minchar, char maxchar) { int len = 0; static char lastc = 'x'; + *ptr = '\0'; + while (len < maxlen) { c = md_getc(); if (c == '\n' || c == '\0') { @@ -76,7 +78,7 @@ int md_getstring(char *ptr, int maxlen, char minchar, char maxchar) { } if (c == '\b' || c == 127) { if (len > 0) { - md_printf("\x1b[D \x1b[D"); + md_printf("\b \b"); len--; ptr[len] = '\0'; } @@ -92,4 +94,4 @@ int md_getstring(char *ptr, int maxlen, char minchar, char maxchar) { } return len; -} \ No newline at end of file +} diff --git a/MagiDoor.h b/MagiDoor.h index 041807f..e83f998 100644 --- a/MagiDoor.h +++ b/MagiDoor.h @@ -1,6 +1,11 @@ #ifndef __MAGIDOOR_H__ #define __MAGIDOOR_H__ +#include + +#define MAGIDOOR_VERSION_MAJOR 1 +#define MAGIDOOR_VERSION_MINOR 2 + #define TRUE 1 #define FALSE 0 @@ -28,4 +33,4 @@ extern void md_sendfile(const char *filename, int pause); extern void md_clr_scr(); extern void md_set_cursor(int y, int x); extern char md_get_answer(char *options); -#endif \ No newline at end of file +#endif