Re: [dev] Suckless unit testing in C?

2015-02-25 Thread Rian Hunter
On Wed, Feb 25, 2015 at 07:45:58AM +0100, Anselm R Garbe wrote: > All you need is creating test input, save the test output and whenever > you call main() with the same test input, you just check for > regressions in the test output compared to the expected test output. Dunno, this seems awfully r

Re: [dev] [st] crash on font resize (patch inside)

2015-02-21 Thread Rian Hunter
On Feb 16, 2015, at 1:23 PM, k...@shike2.com wrote: >> I think the base assumptions programmers have about pointers is >> different from integers. Pointers with null values are universally >> known to be special and a case that should be checked for. With >> integers, it's not obvious what the va

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread Rian Hunter
On Feb 15, 2015, at 8:52 AM, k...@shike2.com wrote: >> Maybe still add an assert() against the divisor != 0 before the code in the >> other patch. >> >> Just so people in the future will know that if it does == 0 there is a logic >> error elsewhere in the program. > > I don't like this idea, b

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread Rian Hunter
Maybe still add an assert() against the divisor != 0 before the code in the other patch. Just so people in the future will know that if it does == 0 there is a logic error elsewhere in the program. > On Feb 15, 2015, at 2:05 AM, Nils Reuße wrote: > >> On 15.02.2015 11:01, k...@shike2.com wrot

Re: [dev] [st] [PATCH] Correct shift amount on MODE_INSERT in tputc()

2015-01-30 Thread Rian Hunter
On Fri, Jan 30, 2015 at 08:14:59PM +0100, FRIGN wrote: > On Fri, 30 Jan 2015 09:53:41 -0800 > Rian Hunter wrote: > > I'd really appreciate it if there were a longer comment detailing how > > word wrap, auto newline insertion, and overflow handling are supposed to be >

Re: [dev] [st] [PATCH] Correct shift amount on MODE_INSERT in tputc()

2015-01-30 Thread Rian Hunter
On Fri, Jan 30, 2015 at 12:19:18PM +0100, k...@shike2.com wrote: > > On Fri, Jan 30, 2015 at 12:41 AM, FRIGN wrote: > >> On Thu, 29 Jan 2015 15:08:39 -0800 > >> Rian Hunter wrote: > >> > >>> When MODE_INSERT is set we'd shift characters o

Re: [dev] [st] [PATCH] Correct shift amount on MODE_INSERT in tputc()

2015-01-29 Thread Rian Hunter
Oops last patch sent was a little off. This one is more correct.a >From 5e94d1031f349050f86c943c87ccf13eb74ccbc3 Mon Sep 17 00:00:00 2001 From: Rian Hunter Date: Thu, 29 Jan 2015 15:00:39 -0800 Subject: [PATCH] Correct shift amount on MODE_INSERT in tputc() When MODE_INSERT is set we'

[dev] [st] [PATCH] Correct shift amount on MODE_INSERT in tputc()

2015-01-29 Thread Rian Hunter
When MODE_INSERT is set we'd shift characters on the same line forward before inserting our character in tputc(). This did not account for wide characters where width != 1. This patch makes it so we shift the correct amount. --- st.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[dev] [st] [PATCH] Fix crash due to wide characters

2015-01-29 Thread Rian Hunter
In tputc(), when a character wasn't large enough to fit on the current line, we would call tnewline() to place it on the next line. Unfortunately, we weren't resetting our glyph pointer and this caused memory corruption when a wide character (width == 2) was being written. This patch resets our gly