diff src/gui.c @ 9:d2cd8c5672fa

Increase filename limit 256 bytes is enough for anybody
author Paper <mrpapersonic@gmail.com>
date Wed, 26 Jan 2022 23:12:41 -0500
parents d1e5b8390cd3
children 423aa3429d21
line wrap: on
line diff
--- a/src/gui.c	Wed Jan 26 22:32:41 2022 -0500
+++ b/src/gui.c	Wed Jan 26 23:12:41 2022 -0500
@@ -11,7 +11,7 @@
 
 HWND hWndListBox, hWndComboBox;
 int16_t version = 11, type = 1; /* type: 0 is vf, 1 is veg */
-char* file_name = " "; /* initialize as a space, a filename cannot literally just be a space */
+char* file_name = " "; /* initialize as a space, a (windows) filename can't just be a space */
 
 void set_data(unsigned char magic[], uint16_t version, FILE* target) {
 	int i;
@@ -64,14 +64,14 @@
 
 char* open_file(HWND hWnd) {
 	OPENFILENAME ofn;
-	char filename[127];
+	char filename[256];
 
 	ZeroMemory(&ofn, sizeof(OPENFILENAME));
 	ofn.lStructSize = sizeof(OPENFILENAME);
 	ofn.hwndOwner = hWnd;
 	ofn.lpstrFile = filename;
 	ofn.lpstrFile[0] = '\0';
-	ofn.nMaxFile = 127;
+	ofn.nMaxFile = 256;
 	ofn.lpstrFilter = "Project files\0*.veg;*.vf\0All files\0*.*\0";
 	ofn.nFilterIndex = 1;
 
@@ -88,14 +88,14 @@
 		return;
 	}
 	OPENFILENAME ofn;
-	char output_file[127];
+	char output_file[256];
 
 	ZeroMemory(&ofn, sizeof(OPENFILENAME));
 	ofn.lStructSize = sizeof(OPENFILENAME);
 	ofn.hwndOwner = hWnd;
 	ofn.lpstrFile = output_file;
 	ofn.lpstrFile[0] = '\0';
-	ofn.nMaxFile = 127;
+	ofn.nMaxFile = 256;
 	ofn.lpstrFilter = "Project files\0*.veg\0All files\0*.*\0";
 	ofn.nFilterIndex = 1;