Skip to content

Commit e591d85

Browse files
authored
Merge pull request #179 from cs50/develop
9.0.2
2 parents 3d83ff0 + b7af39e commit e591d85

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

Diff for: Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION := 9.0.1
1+
VERSION := 9.0.2
22
MAJOR_VERSION := $(shell echo $(VERSION) | head -c 1)
33

44
# installation directory (/usr/local by default)
@@ -34,7 +34,7 @@ all: $(LIBS) $(MANS)
3434

3535
$(LIBS): $(SRC) $(INCLUDE) Makefile
3636
$(CC) $(CFLAGS) -fPIC -shared $(LINKER_FLAGS) -o $(LIB_VERSION) $(SRC)
37-
ln -sf $(LIB_MAJOR) $(LIB_BASE)
37+
ln -sf $(LIB_VERSION) $(LIB_BASE)
3838
mkdir -p $(addprefix build/, include lib src)
3939
install -m 644 $(SRC) build/src
4040
install -m 644 $(INCLUDE) build/include
@@ -43,8 +43,8 @@ $(LIBS): $(SRC) $(INCLUDE) Makefile
4343
.PHONY: install
4444
install: all
4545
mkdir -p $(addprefix $(DESTDIR)/, src lib include $(MANDIR))
46-
cp -r $(filter-out deb, $(wildcard build/*)) $(DESTDIR)
47-
cp -r $(MANS) $(DESTDIR)/$(MANDIR)
46+
cp -R $(filter-out deb, $(wildcard build/*)) $(DESTDIR)
47+
cp -R $(MANS) $(DESTDIR)/$(MANDIR)
4848

4949
ifeq ($(OS),Linux)
5050
ldconfig $(DESTDIR)/lib

Diff for: src/cs50.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static string *strings = NULL;
7575
* on heap, but library's destructor frees memory on program's exit.
7676
*/
7777
#undef get_string
78-
string get_string(va_list *args, const string format, ...)
78+
string get_string(va_list *args, const char *format, ...)
7979
{
8080
// Check whether we have room for another string
8181
if (allocations == SIZE_MAX / sizeof (string))
@@ -214,7 +214,7 @@ string get_string(va_list *args, const string format, ...)
214214
* equivalent char; if text is not a single char, user is prompted
215215
* to retry. If line can't be read, returns CHAR_MAX.
216216
*/
217-
char get_char(const string format, ...)
217+
char get_char(const char *format, ...)
218218
{
219219
va_list ap;
220220
va_start(ap, format);
@@ -246,7 +246,7 @@ char get_char(const string format, ...)
246246
* a double or if value would cause underflow or overflow, user is
247247
* prompted to retry. If line can't be read, returns DBL_MAX.
248248
*/
249-
double get_double(const string format, ...)
249+
double get_double(const char *format, ...)
250250
{
251251
va_list ap;
252252
va_start(ap, format);
@@ -287,7 +287,7 @@ double get_double(const string format, ...)
287287
* a float or if value would cause underflow or overflow, user is prompted
288288
* to retry. If line can't be read, returns FLT_MAX.
289289
*/
290-
float get_float(const string format, ...)
290+
float get_float(const char *format, ...)
291291
{
292292
va_list ap;
293293
va_start(ap, format);
@@ -329,7 +329,7 @@ float get_float(const string format, ...)
329329
* or would cause underflow or overflow, user is prompted to retry. If line
330330
* can't be read, returns INT_MAX.
331331
*/
332-
int get_int(const string format, ...)
332+
int get_int(const char *format, ...)
333333
{
334334
va_list ap;
335335
va_start(ap, format);
@@ -366,7 +366,7 @@ int get_int(const string format, ...)
366366
* [-2^63, 2^63 - 1) or would cause underflow or overflow, user is
367367
* prompted to retry. If line can't be read, returns LONG_MAX.
368368
*/
369-
long get_long(const string format, ...)
369+
long get_long(const char *format, ...)
370370
{
371371
va_list ap;
372372
va_start(ap, format);

Diff for: src/cs50.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -60,39 +60,39 @@ typedef char *string;
6060
* equivalent char; if text is not a single char, user is prompted
6161
* to retry. If line can't be read, returns CHAR_MAX.
6262
*/
63-
char get_char(const string format, ...) __attribute__((format(printf, 1, 2)));
63+
char get_char(const char *format, ...) __attribute__((format(printf, 1, 2)));
6464

6565
/**
6666
* Prompts user for a line of text from standard input and returns the
6767
* equivalent double as precisely as possible; if text does not represent
6868
* a double or if value would cause underflow or overflow, user is
6969
* prompted to retry. If line can't be read, returns DBL_MAX.
7070
*/
71-
double get_double(const string format, ...) __attribute__((format(printf, 1, 2)));
71+
double get_double(const char *format, ...) __attribute__((format(printf, 1, 2)));
7272

7373
/**
7474
* Prompts user for a line of text from standard input and returns the
7575
* equivalent float as precisely as possible; if text does not represent
7676
* a float or if value would cause underflow or overflow, user is prompted
7777
* to retry. If line can't be read, returns FLT_MAX.
7878
*/
79-
float get_float(const string format, ...) __attribute__((format(printf, 1, 2)));
79+
float get_float(const char *format, ...) __attribute__((format(printf, 1, 2)));
8080

8181
/**
8282
* Prompts user for a line of text from standard input and returns the
8383
* equivalent int; if text does not represent an int in [-2^31, 2^31 - 1)
8484
* or would cause underflow or overflow, user is prompted to retry. If line
8585
* can't be read, returns INT_MAX.
8686
*/
87-
int get_int(const string format, ...) __attribute__((format(printf, 1, 2)));
87+
int get_int(const char *format, ...) __attribute__((format(printf, 1, 2)));
8888

8989
/**
9090
* Prompts user for a line of text from standard input and returns the
9191
* equivalent long; if text does not represent a long in
9292
* [-2^63, 2^63 - 1) or would cause underflow or overflow, user is
9393
* prompted to retry. If line can't be read, returns LONG_MAX.
9494
*/
95-
long get_long(const string format, ...) __attribute__((format(printf, 1, 2)));
95+
long get_long(const char *format, ...) __attribute__((format(printf, 1, 2)));
9696

9797
/**
9898
* Prompts user for a line of text from standard input and returns
@@ -102,7 +102,7 @@ long get_long(const string format, ...) __attribute__((format(printf, 1, 2)));
102102
* upon error or no input whatsoever (i.e., just EOF). Stores string
103103
* on heap, but library's destructor frees memory on program's exit.
104104
*/
105-
string get_string(va_list *args, const string format, ...) __attribute__((format(printf, 2, 3)));
105+
string get_string(va_list *args, const char *format, ...) __attribute__((format(printf, 2, 3)));
106106
#define get_string(...) get_string(NULL, __VA_ARGS__)
107107

108108
#endif

0 commit comments

Comments
 (0)