[gtk/file-replace-trap: 2/2] inspector: Fix saving css




commit 0108ffe0597529228a1dc5c6a8da5382e443caa6
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun May 9 11:17:48 2021 -0400

    inspector: Fix saving css
    
    g_file_replace_contents() does not accept -1
    as length, unlike similar apis.

 gtk/inspector/css-editor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/inspector/css-editor.c b/gtk/inspector/css-editor.c
index de79175ed2..8047545b62 100644
--- a/gtk/inspector/css-editor.c
+++ b/gtk/inspector/css-editor.c
@@ -192,7 +192,7 @@ save_to_file (GtkInspectorCssEditor *ce,
 
   text = get_current_text (ce->priv->text);
 
-  g_file_replace_contents (file, text, -1,
+  g_file_replace_contents (file, text, strlen (text),
                            NULL,
                            FALSE,
                            G_FILE_CREATE_NONE,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]