File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -1266,18 +1266,6 @@ static void wrap_in_html(struct strbuf *msg)
1266
1266
* msg = buf ;
1267
1267
}
1268
1268
1269
- #define CHUNKSIZE 0x1000
1270
-
1271
- static int read_message (FILE * f , struct strbuf * all_msgs )
1272
- {
1273
- do {
1274
- if (strbuf_fread (all_msgs , CHUNKSIZE , f ) <= 0 )
1275
- break ;
1276
- } while (!feof (f ));
1277
-
1278
- return ferror (f ) ? -1 : 0 ;
1279
- }
1280
-
1281
1269
static int count_messages (struct strbuf * all_msgs )
1282
1270
{
1283
1271
int count = 0 ;
@@ -1582,8 +1570,8 @@ int cmd_main(int argc, const char **argv)
1582
1570
}
1583
1571
1584
1572
/* read the messages */
1585
- if (read_message ( stdin , & all_msgs ) ) {
1586
- fprintf ( stderr , "error reading input\n" );
1573
+ if (strbuf_read ( & all_msgs , 0 , 0 ) < 0 ) {
1574
+ error_errno ( _ ( "could not read from stdin" ) );
1587
1575
return 1 ;
1588
1576
}
1589
1577
You can’t perform that action at this time.
0 commit comments