Changes between Version 37 and Version 38 of Hacking


Ignore:
Timestamp:
12/08/24 11:01:54 (3 weeks ago)
Author:
andrew_b
Comment:

Change example. The result of vfs_path_from_str() should not be const because it must be destroyed using vfs_path_free().

Legend:

Unmodified
Added
Removed
Modified
  • Hacking

    v37 v38  
    271271'''This is right:''' 
    272272{{{ 
    273 const vfs_path_t *vpath = vfs_path_from_str (filename); 
    274 }}} 
    275  
    276 '''This is wrong:''' 
    277 {{{ 
    278 vfs_path_t *vpath; 
    279  
    280 vpath = vfs_path_from_str (filename); 
     273const ssize_t len = mc_readlink (vpath, buf, sizeof (buf) - 1); 
     274}}} 
     275 
     276'''This is wrong:''' 
     277{{{ 
     278ssize_t len; 
     279 
     280len = mc_readlink (vpath, buf, sizeof (buf) - 1); 
    281281}}} 
    282282