summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2019-03-03 12:02:57 -0500
committerJason Woodward2019-03-03 12:02:57 -0500
commiteb4f054ec4ad302062080d738300371374399320 (patch)
tree9f35715d597014260507a34313028cb996967c55
parent80d5c9f17a9e5ccfd5aa19e7857046a434f105f4 (diff)
downloadslapt-src-eb4f054ec4ad302062080d738300371374399320.tar.gz
use %m and no -pedantic for c99 sscanf
-rw-r--r--ChangeLog3
-rw-r--r--configure.ac2
-rw-r--r--src/Makefile.am2
-rw-r--r--src/source.c22
4 files changed, 15 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index a844092..0763ca0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
-0.3.3 Jun 21, 2018
+0.3.3 Mar 03, 2019
+ * use %m and no -pedantic for c99 sscanf
* build fixes
* tx pull
* use c99 stdbool (libslapt compat)
diff --git a/configure.ac b/configure.ac
index 791eb6a..111a5a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@ arm*) host_cpu=arm ;;
esac
# Checks for programs.
-AC_PROG_CC
+AC_PROG_CC_C99
# Checks for libraries.
diff --git a/src/Makefile.am b/src/Makefile.am
index 251eaa9..6678a73 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,5 +2,5 @@
bin_PROGRAMS = slapt-src
slapt_src_SOURCES = main.c source.c source.h
slapt_src_LDADD = $(LIBOBJS) $(LIBS)
-slapt_src_CPPFLAGS = $(CFLAGS) -Wall -pedantic -Wshadow -Wstrict-overflow -fno-strict-aliasing
+slapt_src_CPPFLAGS = $(CFLAGS) -Wall -Wshadow -Wstrict-overflow -fno-strict-aliasing
diff --git a/src/source.c b/src/source.c
index 0c12b01..76c1aea 100644
--- a/src/source.c
+++ b/src/source.c
@@ -413,22 +413,22 @@ slapt_src_slackbuild_list *slapt_src_get_slackbuilds_from_file(const char *dataf
if (strstr(buffer, ": \n") != NULL)
continue;
- if ((sscanf(buffer, "SLACKBUILD NAME: %as", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD NAME: %ms", &token)) == 1) {
sb->name = strdup(token);
free(token);
}
- if ((sscanf(buffer, "SLACKBUILD SOURCEURL: %as", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD SOURCEURL: %ms", &token)) == 1) {
sb->sb_source_url = strdup(token);
free(token);
}
- if ((sscanf(buffer, "SLACKBUILD LOCATION: %as", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD LOCATION: %ms", &token)) == 1) {
sb->location = strdup(token);
free(token);
}
- if ((sscanf(buffer, "SLACKBUILD FILES: %a[^\n]", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD FILES: %m[^\n]", &token)) == 1) {
int c;
slapt_list_t *files = slapt_parse_delimited_list(token, ' ');
for (c = 0; c < files->count; c++) {
@@ -438,37 +438,37 @@ slapt_src_slackbuild_list *slapt_src_get_slackbuilds_from_file(const char *dataf
free(token);
}
- if ((sscanf(buffer, "SLACKBUILD VERSION: %a[^\n]", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD VERSION: %m[^\n]", &token)) == 1) {
sb->version = strdup(token);
free(token);
}
- if ((sscanf(buffer, "SLACKBUILD DOWNLOAD: %a[^\n]", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD DOWNLOAD: %m[^\n]", &token)) == 1) {
sb->download = strdup(token);
free(token);
}
- if ((sscanf(buffer, "SLACKBUILD DOWNLOAD_x86_64: %a[^\n]", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD DOWNLOAD_x86_64: %m[^\n]", &token)) == 1) {
sb->download_x86_64 = strdup(token);
free(token);
}
- if ((sscanf(buffer, "SLACKBUILD MD5SUM: %a[^\n]", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD MD5SUM: %m[^\n]", &token)) == 1) {
sb->md5sum = strdup(token);
free(token);
}
- if ((sscanf(buffer, "SLACKBUILD MD5SUM_x86_64: %a[^\n]", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD MD5SUM_x86_64: %m[^\n]", &token)) == 1) {
sb->md5sum_x86_64 = strdup(token);
free(token);
}
- if ((sscanf(buffer, "SLACKBUILD REQUIRES: %a[^\n]", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD REQUIRES: %m[^\n]", &token)) == 1) {
sb->requires = strdup(token);
free(token);
}
- if ((sscanf(buffer, "SLACKBUILD SHORT DESCRIPTION: %a[^\n]", &token)) == 1) {
+ if ((sscanf(buffer, "SLACKBUILD SHORT DESCRIPTION: %m[^\n]", &token)) == 1) {
sb->short_desc = strdup(token);
free(token);
}