• M
    virStrndup: Accept negative values as string length · c9357196
    Michal Privoznik 提交于
    It may shorten the code a bit as the following pattern:
    
      VIR_STRNDUP(dst, src, cond ? n : strlen(src))
    
    is used on several places among our code. However, we can
    move the strlen into virStrndup and thus write just:
    
      VIR_STRNDUP(dst, src, cond ? n : -1)
    c9357196
virstring.h 6.0 KB