Skip to content

Commit

Permalink
Added "const" to ngx_memcpy() with NGX_MEMCPY_LIMIT defined.
Browse files Browse the repository at this point in the history
This fixes warning produced during compilation of the ngx_http_geoip_module
due to const qualifier being discarded.
  • Loading branch information
mdounin committed Aug 3, 2012
1 parent e00e78d commit f5321cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/ngx_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ ngx_sort(void *base, size_t n, size_t size,
#if (NGX_MEMCPY_LIMIT)

void *
ngx_memcpy(void *dst, void *src, size_t n)
ngx_memcpy(void *dst, const void *src, size_t n)
{
if (n > NGX_MEMCPY_LIMIT) {
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, "memcpy %uz bytes", n);
Expand Down
2 changes: 1 addition & 1 deletion src/core/ngx_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ngx_strlchr(u_char *p, u_char *last, u_char c)

#if (NGX_MEMCPY_LIMIT)

void *ngx_memcpy(void *dst, void *src, size_t n);
void *ngx_memcpy(void *dst, const void *src, size_t n);
#define ngx_cpymem(dst, src, n) (((u_char *) ngx_memcpy(dst, src, n)) + (n))

#else
Expand Down

0 comments on commit f5321cf

Please sign in to comment.