- Make sure to not mix allocators by using the correct StrDup function.

- Include needed system header.
Review URL: http://codereview.chromium.org/11547

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@812 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
iposva@chromium.org 2008-11-20 23:53:18 +00:00
parent 3fc91f93a9
commit 8831e4ab8f

View File

@ -26,6 +26,8 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdlib.h>
#include "d8.h"
#include "debug.h"
#include "api.h"
@ -77,7 +79,7 @@ i::SmartPointer<char> DumbLineEditor::Prompt(const char* prompt) {
char buffer[kBufferSize];
printf("%s", prompt);
char* str = fgets(buffer, kBufferSize, stdin);
return i::SmartPointer<char>(str ? i::OS::StrDup(str) : str);
return i::SmartPointer<char>(str ? i::StrDup(str) : str);
}