Ticket #3922: type.patch

File type.patch, 1.1 KB (added by adamm, 6 years ago)
  • src/vfs/fish/fish.c

    commit e4a74e1f7bfbe71dd0ab067e79812ebb3921ca27
    Author: Adam Majer <amajer@suse.de>
    Date:   Tue Jun 26 11:51:47 2018 +0200
    
        Ticket #3922: Cast to correct type
        
        Octal is an unsigned int, not a signed int
        
        fish.c:1360:64: format ‘%o’ expects argument of type ‘unsigned int’, but argument 7 has type ‘int’
               "FISH_FILENAME=%s FISH_FILEMODE=%4.4o;\n", rpath, (int) (mode & 07777));
                                               ~~~~^             ~~~~~~~~~~~~~~~~~~~~
                                               %4.4o
        
        Signed-off-by: Adam Majer <amajer@suse.de>
    
    diff --git a/src/vfs/fish/fish.c b/src/vfs/fish/fish.c
    index d14631565..aff896bc5 100644
    a b fish_chmod (const vfs_path_t * vpath, mode_t mode) 
    13571357 
    13581358    ret = 
    13591359        fish_send_command (path_element->class, super, OPT_FLUSH, SUP->scr_chmod, 
    1360                            "FISH_FILENAME=%s FISH_FILEMODE=%4.4o;\n", rpath, (int) (mode & 07777)); 
     1360                           "FISH_FILENAME=%s FISH_FILEMODE=%4.4o;\n", rpath, (unsigned) (mode & 07777)); 
    13611361 
    13621362    g_free (rpath); 
    13631363