[hackers] [surf] Fixing the bug of surf loading undefined data in arg. || Christoph Lohmann

From: <hg_AT_suckless.org>
Date: Thu, 8 Nov 2012 22:07:38 +0100 (CET)

changeset: 261:51ad1615f445
tag: tip
user: Christoph Lohmann <20h_AT_r-36.net>
date: Thu Nov 08 22:05:40 2012 +0100
files: surf.c
description:
Fixing the bug of surf loading undefined data in arg.


diff -r 84505a4b862b -r 51ad1615f445 surf.c
--- a/surf.c Wed Oct 31 21:25:42 2012 +0100
+++ b/surf.c Thu Nov 08 22:05:40 2012 +0100
_AT_@ -453,8 +453,7 @@
 linkhover(WebKitWebView *v, const char* t, const char* l, Client *c) {
         if(l) {
                 c->linkhover = copystr(&c->linkhover, l);
- }
- else if(c->linkhover) {
+ } else if(c->linkhover) {
                 free(c->linkhover);
                 c->linkhover = NULL;
         }
_AT_@ -504,8 +503,7 @@
         /* prevents endless loop */
         if(c->uri && strcmp(u, c->uri) == 0) {
                 reload(c, &a);
- }
- else {
+ } else {
                 webkit_web_view_load_uri(c->view, u);
                 c->progress = 0;
                 c->title = copystr(&c->title, u);
_AT_@ -905,6 +903,7 @@
                 gtk_widget_hide_all(c->indicator);
                 t = g_strdup(c->title);
         }
+
         gtk_window_set_title(GTK_WINDOW(c->win), t);
         g_free(t);
 }
_AT_@ -944,6 +943,8 @@
 main(int argc, char *argv[]) {
         Arg arg;
 
+ memset(&arg, 0, sizeof(arg));
+
         /* command line args */
         ARGBEGIN {
         case 'c':
_AT_@ -985,6 +986,7 @@
         newclient();
         if(arg.v)
                 loaduri(clients, &arg);
+
         gtk_main();
         cleanup();
 
Received on Thu Nov 08 2012 - 22:07:38 CET

This archive was generated by hypermail 2.3.0 : Thu Nov 08 2012 - 22:12:07 CET