Update years of packaging copyright.
[debian/bti.git] / bti.c
diff --git a/bti.c b/bti.c
index ea464f1d4e3c4ef5f38b17408782c8879464b828..feaab366dd08ceff42ff3d2129df9b4c034c2015 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -194,6 +194,7 @@ static int send_tweet(struct session *session)
        CURLcode res;
        struct curl_httppost *formpost = NULL;
        struct curl_httppost *lastptr = NULL;
+       struct curl_slist *slist = NULL;
 
        if (!session)
                return -EINVAL;
@@ -220,6 +221,12 @@ static int send_tweet(struct session *session)
        switch (session->host) {
        case HOST_TWITTER:
                curl_easy_setopt(curl, CURLOPT_URL, twitter_url);
+               /*
+                * twitter doesn't like the "Expect: 100-continue" header
+                * anymore, so turn it off.
+                */
+               slist = curl_slist_append(slist, "Expect:");
+               curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);
                break;
        case HOST_IDENTICA:
                curl_easy_setopt(curl, CURLOPT_URL, identica_url);
@@ -418,7 +425,7 @@ int main(int argc, char *argv[], char *envp[])
        }
 #endif
        tweet = get_string_from_stdin();
-       if (strlen(tweet) == 0) {
+       if (!tweet || strlen(tweet) == 0) {
                dbg("no tweet?\n");
                return -1;
        }