Skip to content

Commit

Permalink
Fix bug introduced in 93e9fbf on variadic parameters forwarding.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmellado committed Aug 22, 2017
1 parent 4b78a17 commit c8ad84e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/super4pcs/io/io_ply.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,10 @@ almostsafefread ( void * ptr, size_t size, size_t count, FILE * stream ){
return (result == count);
}

template<int targetCount = 1>
template<int targetCount, typename... Args>
inline bool
almostsafefscanf ( FILE * stream, const char * format, ... ){
va_list args;
va_start(args, format);
int count = fscanf (stream,format, args);
va_end(args);
almostsafefscanf ( FILE * stream, const char * format, Args&&... args ){
int count = fscanf (stream,format, std::forward<Args>(args)...);
return (count == targetCount);
}

Expand Down

0 comments on commit c8ad84e

Please # to comment.