Skip to content
  • Philip Withnall's avatar
    gbase64: Fix documentation for line wrapping lengths · 8d3c5020
    Philip Withnall authored
    The implementation has always wrapped at 76 characters, rather than 72,
    ever since it was introduced in commit 5cf8f1d4
    
     in 2006. At this
    stage, it’s probably best to fix the documentation rather than the
    implementation.
    
    The likely bug in the implementation is the comparison
    ```
    (++already) >= 19
    ```
    
    19 × 4 = 76, so it seems like an off-by-one error in the comparison.
    What was actually wanted was 18 × 4 = 72.
    
    Thanks to Simon McVittie for the investigation and diagnosis.
    
    Signed-off-by: default avatarPhilip Withnall <withnall@endlessm.com>
    
    Fixes: #1997
    8d3c5020