simon-git: puzzles (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Fri Sep 27 22:34:27 BST 2024


TL;DR:
  182b3d9 Pattern: fix three bugs in game_text_format.

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2024-09-27 22:34:27

commit 182b3d9e27981c03df07cc86d8f794ad218dc350
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=182b3d9e27981c03df07cc86d8f794ad218dc350;hp=a9601a678a0613b388a1bcbd5141759acf6a577f
Author: Simon Tatham <anakin at pobox.com>
Date:   Fri Sep 27 22:28:57 2024 +0100

    Pattern: fix three bugs in game_text_format.
    
    A user reported that, on the default square board size, the clues were
    printed in the right places, but the grid contents were accidentally
    transposed by swapping the x and y coordinates. Oops!
    
    Trying to reproduce this, my dev build was running under ASan, which
    pointed out two further buffer handling bugs. The initial sprintf put
    the terminating NUL one char too early in the buffer, so that it was
    overwritten by the bottom right corner of the grid and no NUL ended up
    in the buffer at all; also, the separate buffer for formatting numeric
    clues in the left margin was sized one char too short, because the NUL
    at the end of it hadn't been counted. Apparently in a non-ASan
    environment both of those could work anyway by chance.

 pattern.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)



More information about the tartarus-commits mailing list