Yaakov Selkowitz 04f7db
--- a/flint/flint.cpp
Yaakov Selkowitz 04f7db
+++ b/flint/flint.cpp
Yaakov Selkowitz 04f7db
@@ -117,7 +117,7 @@ void usage(bool full = false)
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
-    const char *descr =
Yaakov Selkowitz 04f7db
+    const char descr[] =
Yaakov Selkowitz 04f7db
 #ifdef FOR_MAN
Yaakov Selkowitz 04f7db
     ".TH \"flint\" \"\" \"Mar 2013\" \"MFT 3.0.0\" \"Administration\"\n"
Yaakov Selkowitz 04f7db
     MAN_SH("NAME")
Yaakov Selkowitz 04f7db
@@ -371,7 +371,7 @@ MAN_BR
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
-    const char* full_descr =
Yaakov Selkowitz 04f7db
+    const char full_descr[] =
Yaakov Selkowitz 04f7db
     "\n"
Yaakov Selkowitz 04f7db
     MAN_SS("COMMAND DESCRIPTION")
Yaakov Selkowitz 04f7db
     "\n"
Yaakov Selkowitz 04f7db
@@ -1747,7 +1747,7 @@ int main(int ac, char *av[])
Yaakov Selkowitz 04f7db
                 } else {
Yaakov Selkowitz 04f7db
                     sprintf(curr_ver, "N/A");
Yaakov Selkowitz 04f7db
                 }
Yaakov Selkowitz 04f7db
-                printf(curr_ver); printf("\n");
Yaakov Selkowitz 04f7db
+                printf("%s\n", curr_ver);
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
                 printf("    New FW version:               ");
Yaakov Selkowitz 04f7db
                 if (fileInfo.infoOffs[Operations::II_FwVersion]) {
Yaakov Selkowitz 04f7db
@@ -1755,7 +1755,7 @@ int main(int ac, char *av[])
Yaakov Selkowitz 04f7db
                 } else {
Yaakov Selkowitz 04f7db
                     sprintf(new_ver, "N/A");
Yaakov Selkowitz 04f7db
                 }
Yaakov Selkowitz 04f7db
-                printf(new_ver); printf("\n");
Yaakov Selkowitz 04f7db
+                printf("%s\n", new_ver);
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
                 print_line_to_log("Current FW version on flash: %s,  New FW version: %s\n", curr_ver, new_ver);
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
--- a/flint/flint_ops.cpp
Yaakov Selkowitz 04f7db
+++ b/flint/flint_ops.cpp
Yaakov Selkowitz 04f7db
@@ -353,7 +353,7 @@ bool Operations::CntxFailSafeBurn(Flash&    f,
Yaakov Selkowitz 04f7db
     if (pre_message == NULL) {
Yaakov Selkowitz 04f7db
         sprintf(message, "Burning FW image without signatures");
Yaakov Selkowitz 04f7db
     } else {
Yaakov Selkowitz 04f7db
-        sprintf(message, pre_message);
Yaakov Selkowitz 04f7db
+        sprintf(message, "%s", pre_message);
Yaakov Selkowitz 04f7db
     }
Yaakov Selkowitz 04f7db
     int str_len = strlen(message), restore_len = strlen(RESTORING_MSG);
Yaakov Selkowitz 04f7db
     str_len = (restore_len > str_len) ? restore_len : str_len;
Yaakov Selkowitz 04f7db
@@ -1602,7 +1602,7 @@ bool Operations::BurnFs3Image(Flash& f, FImage& fim, bool need_report)
Yaakov Selkowitz 04f7db
          if (pre_message == NULL) {
Yaakov Selkowitz 04f7db
              sprintf(message, "Burning FW image without signatures");
Yaakov Selkowitz 04f7db
          } else {
Yaakov Selkowitz 04f7db
-             sprintf(message, pre_message);
Yaakov Selkowitz 04f7db
+             sprintf(message, "%s", pre_message);
Yaakov Selkowitz 04f7db
          }
Yaakov Selkowitz 04f7db
          int str_len = strlen(message), restore_len = strlen(RESTORING_MSG);
Yaakov Selkowitz 04f7db
          str_len = (restore_len > str_len) ? restore_len : str_len;
Yaakov Selkowitz 04f7db
@@ -2051,7 +2051,7 @@ bool Operations::Verify(FBase& f, Operations::ImageInfo* info, bool both_images,
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
 bool Operations::GetExpRomVersionWrapper(ImageInfo* info) {
Yaakov Selkowitz 04f7db
     if (!GetExpRomVersion(info)) {
Yaakov Selkowitz 04f7db
-        snprintf(info->expRomErrMsg, MAX_ROM_ERR_MSG_LEN, err());
Yaakov Selkowitz 04f7db
+        snprintf(info->expRomErrMsg, MAX_ROM_ERR_MSG_LEN, "%s", err());
Yaakov Selkowitz 04f7db
         info->expRomErrMsgValid = true;
Yaakov Selkowitz 04f7db
     }
Yaakov Selkowitz 04f7db
     return true;
Yaakov Selkowitz 04f7db
@@ -2288,7 +2288,7 @@ bool Operations::LoadAsExpRom (FBase& f, ImageInfo* info) {
Yaakov Selkowitz 04f7db
     info->_rom_sect.clear();
Yaakov Selkowitz 04f7db
     info->_rom_sect.resize(f.get_size());
Yaakov Selkowitz 04f7db
     if (!f.read(0, &info->_rom_sect[0], f.get_size()))
Yaakov Selkowitz 04f7db
-        return errmsg(f.err());
Yaakov Selkowitz 04f7db
+        return errmsg("%s", f.err());
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
     TOCPUn(&info->_rom_sect[0], info->_rom_sect.size()/4);
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
@@ -4034,7 +4034,7 @@ bool Operations::CheckDevImageAndRom(FBase& f, ImageInfo& flash_info)
Yaakov Selkowitz 04f7db
 {
Yaakov Selkowitz 04f7db
     // Common check for the ROM.
Yaakov Selkowitz 04f7db
     if (!CheckDevImage(f, flash_info, 1)) {
Yaakov Selkowitz 04f7db
-        return errmsg(err());
Yaakov Selkowitz 04f7db
+        return errmsg("%s", err());
Yaakov Selkowitz 04f7db
     }
Yaakov Selkowitz 04f7db
     if (IsRomEmpty(&flash_info)) {
Yaakov Selkowitz 04f7db
         return errmsg("Read ROM failed: The FW does not contain a ROM section");
Yaakov Selkowitz 04f7db
@@ -4055,7 +4055,7 @@ bool Operations::IntegrateDevRomInImage(FImage& fim, ImageInfo& flashInfo, Image
Yaakov Selkowitz 04f7db
     // Compine the image and the rom into new daa
Yaakov Selkowitz 04f7db
     if(!UpdateRomInImage((u_int8_t*)(&new_data[0]), (u_int8_t*)(fim.getBuf()),
Yaakov Selkowitz 04f7db
                          (u_int8_t*)(&flashInfo._rom_sect[0]), rom_size, &actual_image_size)) {
Yaakov Selkowitz 04f7db
-        return errmsg(err());
Yaakov Selkowitz 04f7db
+        return errmsg("%s", err());
Yaakov Selkowitz 04f7db
     }
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
     // close old image and open new image with the rom.
Yaakov Selkowitz 04f7db
@@ -4063,7 +4063,7 @@ bool Operations::IntegrateDevRomInImage(FImage& fim, ImageInfo& flashInfo, Image
Yaakov Selkowitz 04f7db
     fim.open((u_int32_t*)(&new_data[0]), actual_image_size);
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
     if (!VerifyFs2(fim, &fileInfo, false, false, true) || !QueryAll(fim, &fileInfo)) {
Yaakov Selkowitz 04f7db
-        return errmsg(err());
Yaakov Selkowitz 04f7db
+        return errmsg("%s", err());
Yaakov Selkowitz 04f7db
     }
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
     return true;
Yaakov Selkowitz 04f7db
--- a/small_utils/mtserver.c
Yaakov Selkowitz 04f7db
+++ b/small_utils/mtserver.c
Yaakov Selkowitz 04f7db
@@ -149,7 +149,7 @@ int port = DEF_PORT;    /* Default port */
Yaakov Selkowitz 04f7db
     #define FILE_SIZE (NUM_INTS * sizeof(int))
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
 u_int32_t* cr_space;
Yaakov Selkowitz 04f7db
-char sim_str[100] = "\t-i[d]  <id>   - set the device id.\n";
Yaakov Selkowitz 04f7db
+const char sim_str[100] = "\t-i[d]  <id>   - set the device id.\n";
Yaakov Selkowitz 04f7db
 int id;
Yaakov Selkowitz 04f7db
 int fd;
Yaakov Selkowitz 04f7db
 mfile *mopen(const char *name)
Yaakov Selkowitz 04f7db
@@ -297,7 +297,7 @@ int unmap_and_close_file(void)
Yaakov Selkowitz 04f7db
 }
Yaakov Selkowitz 04f7db
 #else
Yaakov Selkowitz 04f7db
 
Yaakov Selkowitz 04f7db
-char sim_str[100] = "";
Yaakov Selkowitz 04f7db
+const char sim_str[100] = "";
Yaakov Selkowitz 04f7db
 int check_id_arg(char* av[], int ac, int *i)
Yaakov Selkowitz 04f7db
 {
Yaakov Selkowitz 04f7db
     ac = 0;