今天遇到 segmentation fault 的問題

查了很久才發現 json_object_get_type 如果傳 null 給他

不一定會掛點...導致有些環境可以有些不行@@

所以程式要這樣寫阿

if( obj && json_object_get_type(obj) == json_type_object)

 

Segmentation fault:when use json_object_get_type

arrow
arrow
    全站熱搜

    JohnDX 發表在 痞客邦 留言(0) 人氣()