Skip to content
Snippets Groups Projects
  • Yorhel's avatar
    a830f7df
    Use C99 flexible array member for struct dir · a830f7df
    Yorhel authored
    This should fix https://dev.yorhel.nl/ncdu/bug/99 - with the downside
    that this requires a C99 compiler.
    
    I also replaced all occurrences of static allocation of struct dir with
    use dynamic allocation, because I wasn't really sure if static
    allocation of flexible structs is allowed. In the case of dirlist.c the
    dynamic allocation is likely required anyway, because it does store a
    few bytes in the name field.
    a830f7df
    History
    Use C99 flexible array member for struct dir
    Yorhel authored
    This should fix https://dev.yorhel.nl/ncdu/bug/99 - with the downside
    that this requires a C99 compiler.
    
    I also replaced all occurrences of static allocation of struct dir with
    use dynamic allocation, because I wasn't really sure if static
    allocation of flexible structs is allowed. In the case of dirlist.c the
    dynamic allocation is likely required anyway, because it does store a
    few bytes in the name field.