Diff of /lib/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp [2c2b33] .. [6528fe]  Maximize  Restore

Repo status: analyzing...

Switch to unified view

a/lib/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp b/lib/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp
...
...
69
#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with visual studio 2005 to avoid warning. 
69
#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with visual studio 2005 to avoid warning. 
70
   sprintf_s(buffer, sizeof(buffer), "%#.16g", value); 
70
   sprintf_s(buffer, sizeof(buffer), "%#.16g", value); 
71
#else   
71
#else   
72
   sprintf(buffer, "%#.16g", value); 
72
   sprintf(buffer, "%#.16g", value); 
73
#endif
73
#endif
74
   char* ch = buffer;
75
   // Incase sprintf have written ',' as decimal point switch it to '.'
76
   while (*ch != '\0'){
77
     if (*ch == ','){
78
       *ch = '.';
79
       break;
80
     }
81
     ch++;
82
   }
83
74
   char* ch = buffer + strlen(buffer) - 1;
84
   ch = buffer + strlen(buffer) - 1;
75
   if (*ch != '0') return buffer; // nothing to truncate, so save time
85
   if (*ch != '0') return buffer; // nothing to truncate, so save time
76
   while(ch > buffer && *ch == '0'){
86
   while(ch > buffer && *ch == '0'){
77
     --ch;
87
     --ch;
78
   }
88
   }
79
   char* last_nonzero = ch;
89
   char* last_nonzero = ch;

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks