Mercurial > pidgin
comparison src/util.c @ 11656:f9c5480ad0ce
[gaim-migrate @ 13940]
The poster of 1253287 says FreeBSD does have a z printf modifier. Someone commented that Solaris doesn't either. I don't know either way, but we use G_GSIZE_FORMAT elsewhere, so I figured it was worth a shot. I rooted out several %z format strings and changed them. It compiles for me. I make no guarantees past that.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Thu, 13 Oct 2005 19:53:09 +0000 |
parents | 11d30825c1bb |
children | 2350fe2bef87 |
comparison
equal
deleted
inserted
replaced
11655:527cf464140b | 11656:f9c5480ad0ce |
---|---|
2016 } | 2016 } |
2017 | 2017 |
2018 /* Ensure the file is the correct size */ | 2018 /* Ensure the file is the correct size */ |
2019 if (byteswritten != real_size) | 2019 if (byteswritten != real_size) |
2020 { | 2020 { |
2021 gaim_debug_error("util", "Error writing to file %s: Wrote %z bytes " | 2021 gaim_debug_error("util", "Error writing to file %s: Wrote %" G_GSIZE_FORMAT " bytes " |
2022 "but should have written %z; is your disk full?\n", | 2022 "but should have written %" G_GSIZE_FORMAT "; is your disk full?\n", |
2023 filename_temp, byteswritten, real_size); | 2023 filename_temp, byteswritten, real_size); |
2024 g_free(filename_full); | 2024 g_free(filename_full); |
2025 g_free(filename_temp); | 2025 g_free(filename_temp); |
2026 return FALSE; | 2026 return FALSE; |
2027 } | 2027 } |
2571 size_mag /= 1024; | 2571 size_mag /= 1024; |
2572 size_index++; | 2572 size_index++; |
2573 } | 2573 } |
2574 | 2574 |
2575 if (size_index == 0) { | 2575 if (size_index == 0) { |
2576 return g_strdup_printf("%zd %s", size, size_str[size_index]); | 2576 return g_strdup_printf("%" G_GSIZE_FORMAT " %s", size, size_str[size_index]); |
2577 } else { | 2577 } else { |
2578 return g_strdup_printf("%.2f %s", size_mag, size_str[size_index]); | 2578 return g_strdup_printf("%.2f %s", size_mag, size_str[size_index]); |
2579 } | 2579 } |
2580 } | 2580 } |
2581 } | 2581 } |
2831 /* If we can find a Content-Length header at all, try to sscanf it. | 2831 /* If we can find a Content-Length header at all, try to sscanf it. |
2832 * Response headers should end with at least \r\n, so sscanf is safe, | 2832 * Response headers should end with at least \r\n, so sscanf is safe, |
2833 * if we make sure that there is indeed a \n in our header. | 2833 * if we make sure that there is indeed a \n in our header. |
2834 */ | 2834 */ |
2835 if (p && g_strstr_len(p, data_len - (p - data), "\n")) { | 2835 if (p && g_strstr_len(p, data_len - (p - data), "\n")) { |
2836 sscanf(p, "Content-Length: %zu", &content_len); | 2836 sscanf(p, "Content-Length: %" G_GSIZE_FORMAT, &content_len); |
2837 gaim_debug_misc("parse_content_len", "parsed %u\n", content_len); | 2837 gaim_debug_misc("parse_content_len", "parsed %u\n", content_len); |
2838 } | 2838 } |
2839 | 2839 |
2840 return content_len; | 2840 return content_len; |
2841 } | 2841 } |