Use arrays rather than pointers for static strings.
authorDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
Fri, 27 Aug 2010 14:56:28 +0000 (16:56 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 2 Sep 2010 01:19:47 +0000 (18:19 -0700)
While this change does not do anything on most common systems, as
executables are not PIC, it is very useful when dealing with Position
Independent Executables (PIE) as used for instance by Gentoo Hardened.

bti.c

diff --git a/bti.c b/bti.c
index 588de2f..a31daed 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -298,25 +298,25 @@ static void bti_curl_buffer_free(struct bti_curl_buffer *buffer)
        free(buffer);
 }
 
-static const char *twitter_host  = "http://api.twitter.com/1/statuses";
-static const char *identica_host = "https://identi.ca/api/statuses";
-static const char *twitter_name  = "twitter";
-static const char *identica_name = "identi.ca";
-
-static const char *twitter_request_token_uri  = "http://twitter.com/oauth/request_token";
-static const char *twitter_access_token_uri   = "http://twitter.com/oauth/access_token";
-static const char *twitter_authorize_uri      = "http://twitter.com/oauth/authorize?oauth_token=";
-static const char *identica_request_token_uri = "http://identi.ca/api/oauth/request_token";
-static const char *identica_access_token_uri  = "http://identi.ca/api/oauth/access_token";
-static const char *identica_authorize_uri     = "http://identi.ca/api/oauth/authorize?oauth_token=";
-
-static const char *user_uri     = "/user_timeline/";
-static const char *update_uri   = "/update.xml";
-static const char *public_uri   = "/public_timeline.xml";
-static const char *friends_uri  = "/friends_timeline.xml";
-static const char *mentions_uri = "/mentions.xml";
-static const char *replies_uri  = "/replies.xml";
-static const char *group_uri    = "/../statusnet/groups/timeline/";
+static const char twitter_host[]  = "http://api.twitter.com/1/statuses";
+static const char identica_host[] = "https://identi.ca/api/statuses";
+static const char twitter_name[]  = "twitter";
+static const char identica_name[] = "identi.ca";
+
+static const char twitter_request_token_uri[]  = "http://twitter.com/oauth/request_token";
+static const char twitter_access_token_uri[]   = "http://twitter.com/oauth/access_token";
+static const char twitter_authorize_uri[]      = "http://twitter.com/oauth/authorize?oauth_token=";
+static const char identica_request_token_uri[] = "http://identi.ca/api/oauth/request_token";
+static const char identica_access_token_uri[]  = "http://identi.ca/api/oauth/access_token";
+static const char identica_authorize_uri[]     = "http://identi.ca/api/oauth/authorize?oauth_token=";
+
+static const char user_uri[]     = "/user_timeline/";
+static const char update_uri[]   = "/update.xml";
+static const char public_uri[]   = "/public_timeline.xml";
+static const char friends_uri[]  = "/friends_timeline.xml";
+static const char mentions_uri[] = "/mentions.xml";
+static const char replies_uri[]  = "/replies.xml";
+static const char group_uri[]    = "/../statusnet/groups/timeline/";
 
 static CURL *curl_init(void)
 {