- add_to_buffer(message_buffer, "error_code: ",MESSAGE_LEVEL_ERROR,PRINT);
- if (MESSAGE_LEVEL_ERROR<=DEBUG_LEVEL) printf("%d\n\n\n",yaffs_get_error()); /*cannot yet add int types to buffer. this is a quick fix*/
- scanf("%c",dummy);
+ add_to_buffer(message_buffer, "error_code: ",MESSAGE_LEVEL_ERROR,NPRINT);
+ yaffs_error=yaffs_get_error();
+ append_int_to_buffer(message_buffer, yaffs_error,MESSAGE_LEVEL_ERROR,PRINT);
+
+ add_to_buffer(message_buffer, error_to_str(yaffs_error),MESSAGE_LEVEL_ERROR,NPRINT);
+ append_to_buffer(message_buffer, "\n\n",MESSAGE_LEVEL_ERROR,PRINT);
+ quit_program();
+ //scanf("%c",dummy); /*this line causes a segmentation fault. Need a better way of waiting for a key press*/