From: roland Date: Thu, 25 Aug 2005 22:38:05 +0000 (+0000) Subject: 2005-08-25 Roland McGrath X-Git-Tag: release-0.3~3 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=65634add379c5afde33fbc7ea3201d24543dd666;p=systemtap.git 2005-08-25 Roland McGrath * loc2c-runtime.h (deref_string): Rewritten using deref. --- diff --git a/runtime/loc2c-runtime.h b/runtime/loc2c-runtime.h index 3b0289f35..91b5a0c5a 100644 --- a/runtime/loc2c-runtime.h +++ b/runtime/loc2c-runtime.h @@ -174,7 +174,13 @@ #define deref_string(dst, addr, maxbytes) \ ({ \ - if (__strncpy_from_user ((dst), (const char __user *) (addr), (maxbytes)))\ - goto deref_fault; \ + uintptr_t _addr; \ + size_t _len; \ + unsigned char _c; \ + char *_d = (dst); \ + for (_len = (maxbytes), _addr = (addr); \ + _len > 1 && (_c = deref (1, _addr)) != '\0'; \ + --_len, ++_addr) \ + *_d++ = _c; \ (dst); \ })