midori_view_save_source needs to handle data == NULL

Fixes: https://bugs.launchpad.net/midori/+bug/957674
This commit is contained in:
Christian Dywan 2012-03-18 00:51:43 +01:00
parent ee8824b93b
commit a3d8a5aa94

View file

@ -5232,7 +5232,7 @@ midori_view_save_source (MidoriView* view,
{ {
if ((fp = fdopen (fd, "w"))) if ((fp = fdopen (fd, "w")))
{ {
ret = fwrite (data->str, 1, data->len, fp); ret = fwrite (data ? data->str : "", 1, data ? data->len : 0, fp);
fclose (fp); fclose (fp);
if ((ret - data->len) != 0) if ((ret - data->len) != 0)
{ {