tgetstr() violates its specification in an egregarious way, as covered in bug #6944. The version of tgetstr() that one gets by linking with -lncurses (alone) breaks in exactly the same way that the -ltermcap version does (possibly it is the same version, but they are different RPM packages, built from different source RPMs, and ldd shows no cross-dependancies). All of my comments in bug #6944 apply equally to the ncurses version of tgetstr().
Which documentation states tgetstr() should accept this? (The man page in ncurses definitely doesn't). The changelog of the libtermcap package actually documents the change as a bugfix, so I believe your code is relying on some other-OS specific function. "Fixing" it is a matter of removing one patch, so if you can convince me that it's the right thing to do, it can be done quickly.