changeset 244:bec9198fc306

aci2 ati_audio.c: my understanding of the 's' parser type was incorrect
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 24 Jul 2017 04:15:14 +0000
parents 619febca2803
children 3b8d291ed45a
files src/aci2/aci/ati_audio.c
diffstat 1 files changed, 10 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/aci2/aci/ati_audio.c	Mon May 29 06:50:47 2017 +0000
+++ b/src/aci2/aci/ati_audio.c	Mon Jul 24 04:15:14 2017 +0000
@@ -84,10 +84,9 @@
 	T_AUDIO_MELODY_E1_PARAMETER e1_param;
 	T_RV_RETURN return_path;
 
-	e1_param.melody_name[0] = 0;
-	cl = parse(cl, "s", (LONG)(sizeof(e1_param.melody_name) - 1),
+	cl = parse(cl, "S", (LONG)(sizeof(e1_param.melody_name)),
 		   e1_param.melody_name);
-	if (!e1_param.melody_name[0])
+	if (!cl || !e1_param.melody_name[0])
 		return (ATI_FAIL);
 	e1_param.loopback = AUDIO_MELODY_NO_LOOPBACK;
 	e1_param.melody_mode = AUDIO_MELODY_NORMAL_MODE;
@@ -106,10 +105,9 @@
 	T_AUDIO_MELODY_E2_PARAMETER e2_param;
 	T_RV_RETURN return_path;
 
-	e2_param.melody_E2_name[0] = 0;
-	cl = parse(cl, "s", (LONG)(sizeof(e2_param.melody_E2_name) - 1),
+	cl = parse(cl, "S", (LONG)(sizeof(e2_param.melody_E2_name)),
 		   e2_param.melody_E2_name);
-	if (!e2_param.melody_E2_name[0])
+	if (!cl || !e2_param.melody_E2_name[0])
 		return (ATI_FAIL);
 	e2_param.E2_loopback = AUDIO_MELODY_NO_LOOPBACK;
 	e2_param.melody_E2_mode = AUDIO_MELODY_NORMAL_MODE;
@@ -127,10 +125,9 @@
 {
 	T_AUDIO_MELODY_E2_LOAD_FILE_INSTR_PARAMETER e2_lsi_param;
 
-	e2_lsi_param.melody_E2_file_name[0] = 0;
-	cl = parse(cl, "s", (LONG)(sizeof(e2_lsi_param.melody_E2_file_name)-1),
+	cl = parse(cl, "S", (LONG)(sizeof(e2_lsi_param.melody_E2_file_name)),
 		   e2_lsi_param.melody_E2_file_name);
-	if (!e2_lsi_param.melody_E2_file_name[0])
+	if (!cl || !e2_lsi_param.melody_E2_file_name[0])
 		return (ATI_FAIL);
 
 	if (audio_melody_E2_load_file_instruments(&e2_lsi_param) == AUDIO_OK)
@@ -193,10 +190,9 @@
 	T_AUDIO_VM_PLAY_PARAMETER play_param;
 	T_RV_RETURN return_path;
 
-	play_param.memo_name[0] = 0;
-	cl = parse(cl, "s", (LONG)(sizeof(play_param.memo_name) - 1),
+	cl = parse(cl, "S", (LONG)(sizeof(play_param.memo_name)),
 		   play_param.memo_name);
-	if (!play_param.memo_name[0])
+	if (!cl || !play_param.memo_name[0])
 		return (ATI_FAIL);
 
 	return_path.addr_id        = NULL;
@@ -235,11 +231,10 @@
 	LONG mic_gain = 0x100, network_gain = 0x100;
 	T_RV_RETURN return_path;
 
-	record_param.memo_name[0] = 0;
-	cl = parse(cl, "sddyy", (LONG)(sizeof(record_param.memo_name) - 1),
+	cl = parse(cl, "Sddyy", (LONG)(sizeof(record_param.memo_name)),
 		   record_param.memo_name, &duration, &compression,
 		   &mic_gain, &network_gain);
-	if (!record_param.memo_name[0] || !duration)
+	if (!cl || !record_param.memo_name[0] || !duration)
 		return (ATI_FAIL);
 	record_param.memo_duration = duration;
 	record_param.compression_mode = compression;