Fossil SCM

/json/diff now handles the no-diff case more gracefully.

stephan 2012-03-09 10:17 trunk
Commit efbecda47076d88a8daa1eae95ddb1caaafc8f46
1 file changed +3 -2
+3 -2
--- src/json_diff.c
+++ src/json_diff.c
@@ -58,12 +58,13 @@
5858
blob_zero(&out);
5959
text_diff(&from, &to, &out, flags);
6060
blob_reset(&from);
6161
blob_reset(&to);
6262
outLen = blob_size(&out);
63
- if(outLen>0){
64
- rc = cson_value_new_string(blob_buffer(&out), blob_size(&out));
63
+ if(outLen>=0){
64
+ rc = cson_value_new_string(blob_buffer(&out),
65
+ (unsigned int)blob_size(&out));
6566
}
6667
blob_reset(&out);
6768
return rc;
6869
}
6970
7071
--- src/json_diff.c
+++ src/json_diff.c
@@ -58,12 +58,13 @@
58 blob_zero(&out);
59 text_diff(&from, &to, &out, flags);
60 blob_reset(&from);
61 blob_reset(&to);
62 outLen = blob_size(&out);
63 if(outLen>0){
64 rc = cson_value_new_string(blob_buffer(&out), blob_size(&out));
 
65 }
66 blob_reset(&out);
67 return rc;
68 }
69
70
--- src/json_diff.c
+++ src/json_diff.c
@@ -58,12 +58,13 @@
58 blob_zero(&out);
59 text_diff(&from, &to, &out, flags);
60 blob_reset(&from);
61 blob_reset(&to);
62 outLen = blob_size(&out);
63 if(outLen>=0){
64 rc = cson_value_new_string(blob_buffer(&out),
65 (unsigned int)blob_size(&out));
66 }
67 blob_reset(&out);
68 return rc;
69 }
70
71

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button