From: Antonio Ospite Date: Thu, 29 Sep 2011 21:13:09 +0000 (+0200) Subject: kinect_upload_fw: fix assigning a string literal to a 'char *' X-Git-Tag: v0.1~14 X-Git-Url: https://git.ao2.it/kinect-audio-setup.git/commitdiff_plain/b1db4ec521ced6df13a131ad070858c3dc422dc8?ds=sidebyside;hp=4df37579a5b8c8aff444a4431907a35c3e01e3ec kinect_upload_fw: fix assigning a string literal to a 'char *' kinect_upload_fw.c:118:19: error: initialization discards ‘const’ qualifier from pointer target type A string literals can be seen as "const char *" or as array of chars, I like the second interpretation better. --- diff --git a/kinect_upload_fw/kinect_upload_fw.c b/kinect_upload_fw/kinect_upload_fw.c index 3a22d5c..da909d5 100644 --- a/kinect_upload_fw/kinect_upload_fw.c +++ b/kinect_upload_fw/kinect_upload_fw.c @@ -115,7 +115,8 @@ static int get_reply(void) { } int main(int argc, char** argv) { - char* filename = "firmware.bin"; + char default_filename[] = "firmware.bin"; + char* filename = default_filename; if (argc == 2) { filename = argv[1]; }