Fix deleting last char on ShowInputPrompt()

This commit is contained in:
d0k3 2016-07-21 00:30:26 +02:00
parent dfd0a4e306
commit 27a77cc474
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#include "image.h"
#include "platform.h"
#include "fatfs/ff.h"
#include "ff.h"
#define RAMDRV_BUFFER_O3DS ((u8*)0x22200000) // in O3DS FCRAM
#define RAMDRV_SIZE_O3DS (0x01C00000) // 28MB

View File

@ -400,7 +400,10 @@ bool ShowInputPrompt(char* inputstr, u32 max_size, u32 resize, const char* alpha
while (cursor_s >= inputstr_size)
cursor_s--;
cursor_a = -1;
} else if (resize == 1) inputstr[0] = alphabet[0];
} else if (resize == 1) {
inputstr[0] = alphabet[0];
cursor_a = 0;
}
} else if (pad_state & BUTTON_Y) {
if (resize && (inputstr_size < max_size - resize)) {
char* inputfrom = inputstr + cursor_s - (cursor_s % resize);