Skip to content
  • YueHaibing's avatar
    staging: fbtft: fix strncmp() size warning · b57f9447
    YueHaibing authored
    
    
    strncmp() stops comparing when either the end of one of the first two
    arguments is reached or when 'n' characters have been compared, whichever
    comes first.That means that strncmp(s1, s2, n) is equivalent to
    strcmp(s1, s2) if n exceeds the length of s1 or the length of s2.
    
    This patch avoids that the following warning is reported by smatch:
    
    drivers/staging/fbtft/fbtft_device.c:1458
     fbtft_device_init() error: strncmp() '"list"' too small (5 vs 32)
    
    Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    b57f9447