update copyright date to 2013
[dpdk.git] / lib / librte_cmdline / cmdline_vt100.c
index ebdc538..40afca8 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  * 
- *   Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
  *   All rights reserved.
  * 
  *   Redistribution and use in source and binary forms, with or without 
@@ -30,7 +30,6 @@
  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * 
- *  version: DPDK.L.1.2.3-3
  */
 
 /*
@@ -102,6 +101,8 @@ const char *cmdline_vt100_commands[] = {
 void
 vt100_init(struct cmdline_vt100 *vt)
 {
+       if (!vt)
+               return;
        vt->state = CMDLINE_VT100_INIT;
 }
 
@@ -132,6 +133,9 @@ vt100_parser(struct cmdline_vt100 *vt, char ch)
        unsigned int size;
        uint8_t c = (uint8_t) ch;
 
+       if (!vt)
+               return -1;
+
        if (vt->bufpos >= CMDLINE_VT100_BUF_SIZE) {
                vt->state = CMDLINE_VT100_INIT;
                vt->bufpos = 0;