Commit e4efcd7
http: offer to cast
This commit moves the `xcurl_off_t()` function, which validates that a
given value fits within the `curl_off_t` data type and then casts it, to
a more central place so that it can be used outside of `remote-curl.c`,
too.
At the same time, this function is renamed to conform better with the
naming convention of the helper functions that safely cast from one data
type to another which has been well established in `git-compat-util.h`.
With this move, `gettext.h` must be `#include`d in `http.h` to allow the
error message to remain translatable.
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>size_t to curl_off_t safely1 parent f368df4 commit e4efcd7
2 files changed
+13
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
98 | 108 | | |
99 | 109 | | |
100 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | 897 | | |
906 | 898 | | |
907 | 899 | | |
| |||
999 | 991 | | |
1000 | 992 | | |
1001 | 993 | | |
1002 | | - | |
| 994 | + | |
1003 | 995 | | |
1004 | 996 | | |
1005 | 997 | | |
| |||
1030 | 1022 | | |
1031 | 1023 | | |
1032 | 1024 | | |
1033 | | - | |
| 1025 | + | |
1034 | 1026 | | |
1035 | 1027 | | |
1036 | 1028 | | |
| |||
1043 | 1035 | | |
1044 | 1036 | | |
1045 | 1037 | | |
1046 | | - | |
| 1038 | + | |
1047 | 1039 | | |
1048 | 1040 | | |
1049 | 1041 | | |
| |||
0 commit comments