blob: dcaaff47dc02227f02d250d3bc4b3c7a88a4e4f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
$NetBSD: patch-ac,v 1.1.1.1 2009/11/24 12:13:02 obache Exp $
Use C++ way for getline(3) less platforms.
--- tests/lookup/test_simple_lookup.cpp.orig 2008-07-21 12:39:27.000000000 +0000
+++ tests/lookup/test_simple_lookup.cpp
@@ -1,3 +1,4 @@
+#include <iostream>
#include <string.h>
#include <stdio.h>
#include <sys/time.h>
@@ -57,7 +58,8 @@ int main( int argc, char * argv[]){
char* linebuf = (char *)malloc ( 1024 * sizeof (char) );
size_t size = 1024;
- while( getline(&linebuf, &size, stdin) ){
+ while( !std::cin.eof() ){
+ std::cin.getline(linebuf, size);
linebuf[strlen(linebuf)-1] = '\0';
if ( strcmp ( linebuf, "quit" ) == 0)
break;
|