comparison src/protocols/oscar/oscar.c @ 7386:414c701ef1ff

[gaim-migrate @ 7981] Code cleanup to get rid of all warnings for AMD64 from augustus at linuxhardware dot org committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 30 Oct 2003 22:27:36 +0000
parents 79d74929693c
children 37384bd2f1b0
comparison
equal deleted inserted replaced
7385:79d74929693c 7386:414c701ef1ff
3888 { 3888 {
3889 aim_icq_ackofflinemsgs(sess); 3889 aim_icq_ackofflinemsgs(sess);
3890 return 1; 3890 return 1;
3891 } 3891 }
3892 3892
3893 /* This function was recommended by the STRFTIME(3) man page to remove the
3894 * "last 2 digits" warning.
3895 */
3896 static size_t my_strftime(char *s, size_t max, const char *fmt,
3897 const struct tm *tm)
3898 {
3899 return strftime(s, max, fmt, tm);
3900 }
3901
3893 static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...) 3902 static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...)
3894 { 3903 {
3895 GaimConnection *gc = sess->aux_data; 3904 GaimConnection *gc = sess->aux_data;
3896 gchar *buf, *tmp, *utf8; 3905 gchar *buf, *tmp, *utf8;
3897 gchar who[16]; 3906 gchar who[16];
3939 char date[30]; 3948 char date[30];
3940 struct tm tm; 3949 struct tm tm;
3941 tm.tm_mday = (int)info->birthday; 3950 tm.tm_mday = (int)info->birthday;
3942 tm.tm_mon = (int)info->birthmonth-1; 3951 tm.tm_mon = (int)info->birthmonth-1;
3943 tm.tm_year = (int)info->birthyear-1900; 3952 tm.tm_year = (int)info->birthyear-1900;
3944 strftime(date, sizeof(date), "%x", &tm); 3953 my_strftime(date, sizeof(date), "%x", &tm);
3945 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Birthday"), ":</b> ", date, NULL); g_free(tmp); 3954 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Birthday"), ":</b> ", date, NULL); g_free(tmp);
3946 } 3955 }
3947 if (info->age) { 3956 if (info->age) {
3948 char age[5]; 3957 char age[5];
3949 snprintf(age, sizeof(age), "%hhd", info->age); 3958 snprintf(age, sizeof(age), "%hhd", info->age);
5839 5848
5840 /* ... insert a new img tag with the oscar id ... */ 5849 /* ... insert a new img tag with the oscar id ... */
5841 if (image->filename) 5850 if (image->filename)
5842 g_string_append_printf(msg, 5851 g_string_append_printf(msg,
5843 "<IMG SRC=\"file://%s\" ID=\"%d\" DATASIZE=\"%d\">", 5852 "<IMG SRC=\"file://%s\" ID=\"%d\" DATASIZE=\"%d\">",
5844 image->filename, oscar_id, image->size); 5853 image->filename, oscar_id, (int)image->size);
5845 else 5854 else
5846 g_string_append_printf(msg, 5855 g_string_append_printf(msg,
5847 "<IMG ID=\"%d\" DATASIZE=\"%d\">", 5856 "<IMG ID=\"%d\" DATASIZE=\"%d\">",
5848 oscar_id, image->size); 5857 oscar_id, (int)image->size);
5849 5858
5850 /* ... and append the data to the binary section ... */ 5859 /* ... and append the data to the binary section ... */
5851 g_string_append_printf(data, "<DATA ID=\"%d\" SIZE=\"%d\">", 5860 g_string_append_printf(data, "<DATA ID=\"%d\" SIZE=\"%d\">",
5852 oscar_id, image->size); 5861 oscar_id, (int)image->size);
5853 data = g_string_append_len(data, image->data, image->size); 5862 data = g_string_append_len(data, image->data, image->size);
5854 data = g_string_append(data, "</DATA>"); 5863 data = g_string_append(data, "</DATA>");
5855 } else { 5864 } else {
5856 /* ... otherwise, allow the possibly invalid img tag through. */ 5865 /* ... otherwise, allow the possibly invalid img tag through. */
5857 /* should we do something else? */ 5866 /* should we do something else? */