File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ double fpconv_strtod(const char *nptr, char **endptr)
130130 /* Duplicate number into buffer */
131131 if (buflen >= FPCONV_G_FMT_BUFSIZE ) {
132132 /* Handle unusually large numbers */
133- buf = malloc (buflen + 1 );
133+ buf = ( char * ) malloc (buflen + 1 );
134134 if (!buf ) {
135135 fprintf (stderr , "Out of memory" );
136136 abort ();
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ static void die(const char *fmt, ...)
3939 va_end (arg );
4040 fprintf (stderr , "\n" );
4141
42- exit ( -1 );
42+ abort ( );
4343}
4444
4545void strbuf_init (strbuf_t * s , size_t len )
@@ -51,7 +51,7 @@ void strbuf_init(strbuf_t *s, size_t len)
5151 else
5252 size = len + 1 ; /* \0 terminator */
5353 if (size < len )
54- die ("Overflow, len %zu" , len );
54+ die ("Overflow, len: %zu" , len );
5555 s -> buf = NULL ;
5656 s -> size = size ;
5757 s -> length = 0 ;
@@ -132,7 +132,7 @@ static size_t calculate_new_size(strbuf_t *s, size_t len)
132132 /* Ensure there is room for optional NULL termination */
133133 reqsize = len + 1 ;
134134 if (reqsize < len )
135- die ("Overflow, len %zu" , len );
135+ die ("Overflow, len: %zu" , len );
136136
137137 /* If the user has requested to shrink the buffer, do it exactly */
138138 if (s -> size > reqsize )
@@ -194,5 +194,6 @@ void strbuf_append_string(strbuf_t *s, const char *str)
194194 }
195195}
196196
197+
197198/* vi:ai et sw=4 ts=4:
198199 */
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ static inline char *strbuf_empty_ptr(strbuf_t *s)
103103
104104static inline void strbuf_set_length (strbuf_t * s , int len )
105105{
106- s -> length + = len ;
106+ s -> length = len ;
107107}
108108
109109static inline void strbuf_extend_length (strbuf_t * s , size_t len )
You can’t perform that action at this time.
0 commit comments