From ebfcee6e67ef9061063ab27fff096f6b705a445b Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Fri, 16 Mar 2012 00:30:27 +0530 Subject: [PATCH] Fixed a crash on inputs like ls x>| less, where x doesn't exist in current directory. --- io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io.h b/io.h index 806ec70c0..5d304cc38 100644 --- a/io.h +++ b/io.h @@ -73,7 +73,7 @@ public: /** Function to get a pointer to the buffer */ char *out_buffer_ptr(void) { assert(out_buffer.get() != NULL); - return &out_buffer->at(0); + return (out_buffer->size() == 0) ? NULL : &out_buffer->at(0); } /** Function to get the size of the buffer */