Skip to content

Instantly share code, notes, and snippets.

@iamleot
Created July 19, 2015 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamleot/eb6dfaa8e6ffb9160b7e to your computer and use it in GitHub Desktop.
Save iamleot/eb6dfaa8e6ffb9160b7e to your computer and use it in GitHub Desktop.
rsstail: handle possible NULL *encoding
dtff --git a/r2t.c b/r2t.c
index ec94369..f444b6c 100644
--- a/r2t.c
+++ b/r2t.c
@@ -439,6 +439,10 @@ int main(int argc, char *argv[])
return 2;
}
+ if (data_cur[cur_url]->encoding == NULL) {
+ data_cur[cur_url]->encoding = "utf-8";
+ }
+
if (verbose)
printf("Creating converter %s -> %s\n", data_cur[cur_url] -> encoding, current_encoding);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment