common: New function decode_c_string.
* common/miscellaneous.c (decode_c_string): New.
This is basically a copy from the code we use in gpgme and gpa.
(cherry picked from commit 6ecedd0b25b6b1a33be63b99f2a8256370000521)
- Signed-off-by: Werner Koch <wk@gnupg.org>