Fix the invalid event handling code.
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 2 May 2013 05:22:08 +0000 (14:22 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 2 May 2013 05:22:08 +0000 (14:22 +0900)
After changing the Event Mask of LB,
The SWITCH-STATEMENT is not working correctly.

Change-Id: I92b0bcc15228df1ba7fa91c6822d1d3be41c4862

src/livebox.c

index ce7a5c2..0ceae6f 100644 (file)
@@ -1451,7 +1451,7 @@ EAPI int livebox_content_event(struct livebox *handler, enum content_event_type
                }
                *ptr++ = 'p';
                *ptr++ = 'd';
-       } else {
+       } else if (type & CONTENT_EVENT_LB_MASK) {
                int flag = 1;
 
                if (type & CONTENT_EVENT_MOUSE_MASK) {
@@ -1481,12 +1481,15 @@ EAPI int livebox_content_event(struct livebox *handler, enum content_event_type
                }
                *ptr++ = 'l';
                *ptr++ = 'b';
+       } else {
+               ErrPrint("Invalid event type\n");
+               return LB_STATUS_ERROR_INVALID;
        }
 
        /*!
         * Must be short than 29 bytes.
         */
-       switch ((type & ~CONTENT_EVENT_PD_MASK)) {
+       switch ((type & ~(CONTENT_EVENT_PD_MASK | CONTENT_EVENT_LB_MASK))) {
        case CONTENT_EVENT_MOUSE_ENTER | CONTENT_EVENT_MOUSE_MASK:
                strcpy(ptr, "_mouse_enter");
                break;