Skip to content

Commit

Permalink
d.histogram: Fix Copy into buffer size issue (OSGeo#4795)
Browse files Browse the repository at this point in the history
* Copy into fix Buffer size issue

* update with glocale

* rearrange headers
  • Loading branch information
ShubhamDesai authored Dec 4, 2024
1 parent 4d852dd commit 8828094
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions display/d.histogram/pie.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@

#include <string.h>

#include <grass/raster.h>
#include <grass/display.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include <grass/raster.h>

#include "pie.h"

Expand Down Expand Up @@ -123,7 +125,10 @@ int pie(struct stat_list *dist_stats, /* list of distribution statistics */
i++;
tic_every = tics[i].every;
tic_unit = tics[i].unit;
strcpy(tic_name, tics[i].name);
if (G_strlcpy(tic_name, tics[i].name, sizeof(tic_name)) >=
sizeof(tic_name)) {
G_fatal_error(_("Tic name <%s> is too long"), tics[i].name);
}
}
else {
if (is_fp && !cat_ranges) {
Expand Down

0 comments on commit 8828094

Please sign in to comment.